Package com.biglybt.core.peer
Interface PEPeerListener
- All Known Implementing Classes:
PiecePickerImpl.PEPeerListenerImpl
public interface PEPeerListener
Listener for peer events.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
removeAvailability
(PEPeer peer, BitFlags peerHavePieces) The peer asserts that their availability must now be taken from the torrent-global availability pool The peer must send this only after having sent a corresponding addAvailability message, and must not send it in a state prior to CLOSING state.void
sentBadChunk
(PEPeer peer, int piece_num, int total_bad_chunks) The peer has sent us a bad piece data chunk.void
stateChanged
(PEPeer peer, int new_state) The peer has changed to the given state.
-
Method Details
-
stateChanged
The peer has changed to the given state.- Parameters:
peer
- the peer the message is aboutnew_state
- of peer
-
sentBadChunk
The peer has sent us a bad piece data chunk.- 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
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- Parameters:
peer
- the message is aboutpeerHavePieces
- BitFlags of pieces availabile
-
removeAvailability
The peer asserts that their availability must now be taken from the torrent-global availability pool The peer must send this only after having sent a corresponding addAvailability message, and must not send it in a state prior to CLOSING state. The BitFlags must be complete, with all pieces from any Bitfield message as well as those from any Have messages.- Parameters:
peer
- the message is aboutpeerHavePieces
- BitFlags of pieces no longer available
-