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 voidaddAvailability(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 voidremoveAvailability(PEPeer peer, BitFlags peerHavePieces) Takes away the given pieces from global availabilityfinal voidsentBadChunk(PEPeer peer, int piece_num, int total_bad_chunks) The peer has sent us a bad piece data chunk.final voidstateChanged(PEPeer peer, int newState) The peer has changed to the given state.
-
Constructor Details
-
PEPeerListenerImpl
private PEPeerListenerImpl()
-
-
Method Details
-
stateChanged
Description copied from interface:PEPeerListenerThe peer has changed to the given state.- Specified by:
stateChangedin interfacePEPeerListener- Parameters:
peer- the peer the message is aboutnewState- of peer
-
sentBadChunk
Description copied from interface:PEPeerListenerThe peer has sent us a bad piece data chunk.- Specified by:
sentBadChunkin 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:PEPeerListenerThe 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:
addAvailabilityin interfacePEPeerListener- Parameters:
peer- the message is aboutpeerHavePieces- BitFlags of pieces availabile
-
removeAvailability
Takes away the given pieces from global availability- Specified by:
removeAvailabilityin interfacePEPeerListener- Parameters:
peer- the message is aboutpeerHavePieces- BitFlags of pieces no longer availablePEPeer- peer this is aboutpeerHasPieces- BitFlags of the pieces
-