Class PiecePickerImpl.PEPeerListenerImpl
java.lang.Object
com.biglybt.core.peermanager.piecepicker.impl.PiecePickerImpl.PEPeerListenerImpl
- All Implemented Interfaces:
PEPeerListener
- Enclosing class:
PiecePickerImpl
An instance of this listener is registered with each peer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAvailability
(PEPeer peer, BitFlags peerHavePieces) The peer asserts that their availability should be added to the torrent-global availability pool The peer must send when, and only when, their availability is known but not after going to CLOSING state.final void
removeAvailability
(PEPeer peer, BitFlags peerHavePieces) Takes away the given pieces from global availabilityfinal void
sentBadChunk
(PEPeer peer, int piece_num, int total_bad_chunks) The peer has sent us a bad piece data chunk.final void
stateChanged
(PEPeer peer, int newState) The peer has changed to the given state.
-
Constructor Details
-
PEPeerListenerImpl
private PEPeerListenerImpl()
-
-
Method Details
-
stateChanged
Description copied from interface:PEPeerListener
The peer has changed to the given state.- Specified by:
stateChanged
in interfacePEPeerListener
- Parameters:
peer
- the peer the message is aboutnewState
- of peer
-
sentBadChunk
Description copied from interface:PEPeerListener
The peer has sent us a bad piece data chunk.- Specified by:
sentBadChunk
in interfacePEPeerListener
- Parameters:
peer
- the peer the message is aboutpiece_num
- piece that failed hash checktotal_bad_chunks
- total number of bad chunks sent by this peer so far
-
addAvailability
Description copied from interface:PEPeerListener
The peer asserts that their availability should be added to the torrent-global availability pool The peer must send when, and only when, their availability is known but not after going to CLOSING state. Upon sending this message, the peer must remember it was sent, and then later send a corresponding removeAvailability message- Specified by:
addAvailability
in interfacePEPeerListener
- Parameters:
peer
- the message is aboutpeerHavePieces
- BitFlags of pieces availabile
-
removeAvailability
Takes away the given pieces from global availability- Specified by:
removeAvailability
in interfacePEPeerListener
- Parameters:
peer
- the message is aboutpeerHavePieces
- BitFlags of pieces no longer availablePEPeer
- peer this is aboutpeerHasPieces
- BitFlags of the pieces
-