Class PiecePickerImpl.PEPeerListenerImpl
- java.lang.Object
-
- com.biglybt.core.peermanager.piecepicker.impl.PiecePickerImpl.PEPeerListenerImpl
-
- All Implemented Interfaces:
PEPeerListener
- Enclosing class:
- PiecePickerImpl
private class PiecePickerImpl.PEPeerListenerImpl extends java.lang.Object implements PEPeerListener
An instance of this listener is registered with each peer
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PEPeerListenerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
removeAvailability(PEPeer peer, BitFlags peerHavePieces)
Takes away the given pieces from global availabilityvoid
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 newState)
The peer has changed to the given state.
-
-
-
Method Detail
-
stateChanged
public final void stateChanged(PEPeer peer, int newState)
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
public final void sentBadChunk(PEPeer peer, int piece_num, int total_bad_chunks)
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
public final void addAvailability(PEPeer peer, BitFlags peerHavePieces)
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
public final void removeAvailability(PEPeer peer, BitFlags peerHavePieces)
Takes away the given pieces from global availability- Specified by:
removeAvailability
in interfacePEPeerListener
- Parameters:
PEPeer
- peer this is aboutpeerHasPieces
- BitFlags of the pieces
-
-