Uses of Class
org.klomp.snark.Peer

Packages that use Peer
org.klomp.snark   
 

Uses of Peer in org.klomp.snark
 

Fields in org.klomp.snark declared as Peer
(package private)  Peer PeerState.peer
           
 

Fields in org.klomp.snark with type parameters of type Peer
(package private)  java.util.List<Peer> PeerCoordinator.peers
           
 

Methods in org.klomp.snark that return types with arguments of type Peer
 java.util.List<Peer> PeerCoordinator.peerList()
           
 

Methods in org.klomp.snark with parameters of type Peer
 boolean PeerCoordinator.addPeer(Peer peer)
           
 boolean Piece.addPeer(Peer peer)
           
 void PeerListener.connected(Peer peer)
          Called when the connection to the peer has started and the handshake was successfull.
 void PeerCoordinator.connected(Peer peer)
           
 void PeerListener.disconnected(Peer peer)
          Called when the connection to the peer was terminated or the connection handshake failed.
 void PeerCoordinator.disconnected(Peer peer)
           
 void PeerListener.downloaded(Peer peer, int size)
          Called when a (partial) piece has been downloaded from the peer.
 void PeerCoordinator.downloaded(Peer peer, int size)
          Called when a peer has downloaded some bytes of a piece.
 boolean PeerListener.gotBitField(Peer peer, BitField bitfield)
          Called when a bitmap message is received.
 boolean PeerCoordinator.gotBitField(Peer peer, BitField bitfield)
          Returns true if the given bitfield contains at least one piece we are interested in.
 void PeerListener.gotChoke(Peer peer, boolean choke)
          Called when a choke message is received.
 void PeerCoordinator.gotChoke(Peer peer, boolean choke)
           
 boolean PeerListener.gotHave(Peer peer, int piece)
          Called when a have piece message is received.
 boolean PeerCoordinator.gotHave(Peer peer, int piece)
          Returns true if we don't have the given piece yet.
 void PeerListener.gotInterest(Peer peer, boolean interest)
          Called when an interested message is received.
 void PeerCoordinator.gotInterest(Peer peer, boolean interest)
           
 boolean PeerListener.gotPiece(Peer peer, int piece, byte[] bs)
          Called when a piece is received from the peer.
 boolean PeerCoordinator.gotPiece(Peer peer, int piece, byte[] bs)
          Returns false if the piece is no good (according to the hash).
 byte[] PeerListener.gotRequest(Peer peer, int piece, int off, int len)
          Called when the peer wants (part of) a piece from us.
 byte[] PeerCoordinator.gotRequest(Peer peer, int piece, int off, int len)
          Returns a byte array containing the requested piece or null of the piece is unknown.
 void PeerListener.markUnrequested(Peer peer)
          Mark a peer's requested pieces unrequested when it is disconnected This prevents premature end game
 void PeerCoordinator.markUnrequested(Peer peer)
          Mark a peer's requested pieces unrequested when it is disconnected Once for each piece This is enough trouble, maybe would be easier just to regenerate the requested list from scratch instead.
 void Snark.peerChange(PeerCoordinator coordinator, Peer peer)
          coordinatorListener
 void CoordinatorListener.peerChange(PeerCoordinator coordinator, Peer peer)
          Called when the PeerCoordinator notices a change in the state of a peer.
 boolean Piece.removePeer(Peer peer)
           
 void PeerCoordinator.removePeerFromPieces(Peer peer)
          Called when a peer is removed, to prevent it from being used in rarest-first calculations.
 void PeerListener.uploaded(Peer peer, int size)
          Called when a (partial) piece has been uploaded to the peer.
 void PeerCoordinator.uploaded(Peer peer, int size)
          Called when a peer has uploaded some bytes of a piece.
 int PeerListener.wantPiece(Peer peer, BitField bitfield)
          Called when we are downloading from the peer and need to ask for a new piece.
 int PeerCoordinator.wantPiece(Peer peer, BitField havePieces)
          Returns one of pieces in the given BitField that is still wanted or -1 if none of the given pieces are wanted.
 

Constructors in org.klomp.snark with parameters of type Peer
PeerConnectionIn(Peer peer, java.io.DataInputStream din)
           
PeerConnectionOut(Peer peer, java.io.DataOutputStream dout)
           
PeerState(Peer peer, PeerListener listener, MetaInfo metainfo, PeerConnectionIn in, PeerConnectionOut out)