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 Object implements PEPeerListener
An instance of this listener is registered with each peer
  • Constructor Details

    • PEPeerListenerImpl

      private PEPeerListenerImpl()
  • Method Details

    • 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 interface PEPeerListener
      Parameters:
      peer - the peer the message is about
      newState - 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 interface PEPeerListener
      Parameters:
      peer - the peer the message is about
      piece_num - piece that failed hash check
      total_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 interface PEPeerListener
      Parameters:
      peer - the message is about
      peerHavePieces - 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 interface PEPeerListener
      Parameters:
      PEPeer - peer this is about
      peerHasPieces - BitFlags of the pieces