Uses of Class
org.klomp.snark.Peer
| Package | Description |
|---|---|
| org.klomp.snark |
I2P version of the snark bittorrent client, imported in 2005 and heavily enhanced
to add a web UI, DHT support, and other features.
|
-
Uses of Peer in org.klomp.snark
Subclasses of Peer in org.klomp.snark Modifier and Type Class Description (package private) classWebPeerBEP 19.Fields in org.klomp.snark with type parameters of type Peer Modifier and Type Field Description (package private) Deque<Peer>PeerCoordinator. peerssynchronize on this when changing peers or downloaders.Methods in org.klomp.snark that return types with arguments of type Peer Modifier and Type Method Description List<Peer>Snark. getPeerList()Set<Peer>TrackerInfo. getPeers()List<Peer>PeerCoordinator. peerList()for web page detailed statsMethods in org.klomp.snark with parameters of type Peer Modifier and Type Method Description booleanPeerCoordinator. addPeer(Peer peer)Add peer (inbound or outbound)booleanPiece. addPeer(Peer peer)caller must synchronizeintPeer. compareTo(Peer p)Deprecated.unused?voidPeerCoordinator. connected(Peer peer)voidPeerListener. connected(Peer peer)Called when the connection to the peer has started and the handshake was successfull.voidPeerCoordinator. disconnected(Peer peer)voidPeerListener. disconnected(Peer peer)Called when the connection to the peer was terminated or the connection handshake failed.voidPeerCoordinator. downloaded(Peer peer, int size)Called when a peer has downloaded some bytes of a piece.voidPeerListener. downloaded(Peer peer, int size)Called when a (partial) piece has been downloaded from the peer.PartialPiecePeerCoordinator. getPartialPiece(Peer peer, BitField havePieces)Return partial piece to the PeerState if it's still wanted and peer has it.PartialPiecePeerListener. getPartialPiece(Peer peer, BitField havePieces)Called when a peer has connected and there may be a partially downloaded piece that the coordinatorator can give the peer taskbooleanPeerCoordinator. gotBitField(Peer peer, BitField bitfield)Returns true if the given bitfield contains at least one piece we are interested in.booleanPeerListener. gotBitField(Peer peer, BitField bitfield)Called when a bitmap message is received.voidPeerCoordinator. gotChoke(Peer peer, boolean choke)this does nothing but loggingvoidPeerListener. gotChoke(Peer peer, boolean choke)Called when a choke message is received.voidPeerCoordinator. gotCommentReq(Peer peer, int num)Called when comments are requested via ut_commentvoidPeerListener. gotCommentReq(Peer peer, int num)Called when comments are requested via ut_commentvoidPeerCoordinator. gotComments(Peer peer, List<Comment> comments)Called when comments are received via ut_commentvoidPeerListener. gotComments(Peer peer, List<Comment> comments)Called when comments are received via ut_commentvoidPeerCoordinator. gotExtension(Peer peer, int id, byte[] bs)PeerListener callbackvoidPeerListener. gotExtension(Peer peer, int id, byte[] bs)Called when an extension message is received.booleanPeerCoordinator. gotHave(Peer peer, int piece)booleanPeerListener. gotHave(Peer peer, int piece)Called when a have piece message is received.voidPeerCoordinator. gotInterest(Peer peer, boolean interest)voidPeerListener. gotInterest(Peer peer, boolean interest)Called when an interested message is received.voidPeerCoordinator. gotPeers(Peer peer, List<PeerID> peers)Get peers from PEX - PeerListener callbackvoidPeerListener. gotPeers(Peer peer, List<PeerID> pIDList)Called when peers are received via PEXbooleanPeerCoordinator. gotPiece(Peer peer, PartialPiece pp)Returns false if the piece is no good (according to the hash).booleanPeerListener. gotPiece(Peer peer, PartialPiece piece)Called when a piece is received from the peer.voidPeerCoordinator. gotPort(Peer peer, int port, int rport)PeerListener callback Tell the DHT to ping it, this will get back the node infovoidPeerListener. gotPort(Peer peer, int port, int rport)Called when a DHT port message is received.ByteArrayPeerCoordinator. gotRequest(Peer peer, int piece, int off, int len)Returns a byte array containing the requested piece or null of the piece is unknown.ByteArrayPeerListener. gotRequest(Peer peer, int piece, int off, int len)Called when the peer wants (part of) a piece from us.static voidExtensionHandler. handleMessage(Peer peer, PeerListener listener, int id, byte[] bs)booleanPiece. isRequestedBy(Peer peer)Is peer requesting this piece? Caller must synchronizestatic voidExtensionHandler. locked_sendComments(Peer peer, int num, CommentSet comments)Send comments Caller must sync on commentsbooleanPeerCoordinator. needPiece(Peer peer, BitField havePieces)Called when we are downloading from the peer and may need to ask for a new piece.booleanPeerListener. needPiece(Peer peer, BitField bitfield)Called when we are downloading from the peer and may need to ask for a new piece.voidCoordinatorListener. peerChange(PeerCoordinator coordinator, Peer peer)Called when the PeerCoordinator notices a change in the state of a peer.voidSnark. peerChange(PeerCoordinator coordinator, Peer peer)CoordinatorListener - this does nothingbooleanPiece. removePeer(Peer peer)Caller must synchronize.voidPeerCoordinator. savePartialPieces(Peer peer, List<Request> partials)Save partial pieces on peer disconnection and hopefully restart it later.voidPeerListener. savePartialPieces(Peer peer, List<Request> pcs)Called when the peer has disconnected and the peer task may have a partially downloaded piece that the PeerCoordinator can savestatic voidExtensionHandler. sendCommentReq(Peer peer, int num)Send comment request(package private) voidPeerCoordinator. sendCommentReq(Peer peer)Send a commment request message to the peer, if he supports it.static voidExtensionHandler. sendDHT(Peer peer, int qport, int rport)Send the DHT port numbers(package private) voidPeerCoordinator. sendDHT(Peer peer)Send a DHT message to the peer, if we both support DHT.(package private) voidPeerCoordinator. sendPeers(Peer peer)Send a PEX message to the peer, if he supports PEX.static voidExtensionHandler. sendPEX(Peer peer, List<Peer> pList)added.f and dropped unsupportedvoidPiece. setRequested(Peer peer, boolean requested)Since 0.8.3, keep track of who is requesting here, to avoid deadlocks from querying each peer.voidPeerCoordinator. uploaded(Peer peer, int size)Called when a peer has uploaded some bytes of a piece.voidPeerListener. uploaded(Peer peer, int size)Called when a (partial) piece has been uploaded to the peer.intPeerCoordinator. 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.intPeerListener. wantPiece(Peer peer, BitField bitfield)Called when we are downloading from the peer and need to ask for a new piece.Method parameters in org.klomp.snark with type arguments of type Peer Modifier and Type Method Description static voidExtensionHandler. sendPEX(Peer peer, List<Peer> pList)added.f and dropped unsupportedConstructors in org.klomp.snark with parameters of type Peer Constructor Description PeerConnectionIn(Peer peer, DataInputStream din)PeerConnectionOut(Peer peer, DataOutputStream dout)PeerState(Peer peer, PeerListener listener, MetaInfo metainfo, PeerConnectionIn in, PeerConnectionOut out)