Uses of Class
org.klomp.snark.Peer
Package
Description
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
Modifier and TypeFieldDescriptionPeerCoordinator.peers
synchronize on this when changing peers or downloaders.Modifier and TypeMethodDescriptionSnark.getPeerList()
TrackerInfo.getPeers()
PeerCoordinator.peerList()
for web page detailed statsModifier and TypeMethodDescriptionboolean
Add peer (inbound or outbound)boolean
caller must synchronizeint
Deprecated.unused?void
void
Called when the connection to the peer has started and the handshake was successfull.void
PeerCoordinator.disconnected
(Peer peer) void
PeerListener.disconnected
(Peer peer) Called when the connection to the peer was terminated or the connection handshake failed.void
PeerCoordinator.downloaded
(Peer peer, int size) Called when a peer has downloaded some bytes of a piece.void
PeerListener.downloaded
(Peer peer, int size) Called when a (partial) piece has been downloaded from the peer.PeerCoordinator.getPartialPiece
(Peer peer, BitField havePieces) Return partial piece to the PeerState if it's still wanted and peer has it.PeerListener.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 taskboolean
PeerCoordinator.gotBitField
(Peer peer, BitField bitfield) Returns true if the given bitfield contains at least one piece we are interested in.boolean
PeerListener.gotBitField
(Peer peer, BitField bitfield) Called when a bitmap message is received.void
this does nothing but loggingvoid
Called when a choke message is received.void
PeerCoordinator.gotCommentReq
(Peer peer, int num) Called when comments are requested via ut_commentvoid
PeerListener.gotCommentReq
(Peer peer, int num) Called when comments are requested via ut_commentvoid
PeerCoordinator.gotComments
(Peer peer, List<Comment> comments) Called when comments are received via ut_commentvoid
PeerListener.gotComments
(Peer peer, List<Comment> comments) Called when comments are received via ut_commentvoid
PeerCoordinator.gotExtension
(Peer peer, int id, byte[] bs) PeerListener callbackvoid
PeerListener.gotExtension
(Peer peer, int id, byte[] bs) Called when an extension message is received.boolean
boolean
Called when a have piece message is received.void
PeerCoordinator.gotInterest
(Peer peer, boolean interest) void
PeerListener.gotInterest
(Peer peer, boolean interest) Called when an interested message is received.void
Get peers from PEX - PeerListener callbackvoid
Called when peers are received via PEXboolean
PeerCoordinator.gotPiece
(Peer peer, PartialPiece pp) Returns false if the piece is no good (according to the hash).boolean
PeerListener.gotPiece
(Peer peer, PartialPiece piece) Called when a piece is received from the peer.void
PeerListener callback Tell the DHT to ping it, this will get back the node infovoid
Called when a DHT port message is received.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.PeerListener.gotRequest
(Peer peer, int piece, int off, int len) Called when the peer wants (part of) a piece from us.static void
ExtensionHandler.handleMessage
(Peer peer, PeerListener listener, int id, byte[] bs) boolean
Piece.isRequestedBy
(Peer peer) Is peer requesting this piece? Caller must synchronizestatic void
ExtensionHandler.locked_sendComments
(Peer peer, int num, CommentSet comments) Send comments Caller must sync on commentsboolean
Called when we are downloading from the peer and may need to ask for a new piece.boolean
Called when we are downloading from the peer and may need to ask for a new piece.void
CoordinatorListener.peerChange
(PeerCoordinator coordinator, Peer peer) Called when the PeerCoordinator notices a change in the state of a peer.void
Snark.peerChange
(PeerCoordinator coordinator, Peer peer) CoordinatorListener - this does nothingboolean
Piece.removePeer
(Peer peer) Caller must synchronize.void
PeerCoordinator.savePartialPieces
(Peer peer, List<Request> partials) Save partial pieces on peer disconnection and hopefully restart it later.void
PeerListener.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 void
ExtensionHandler.sendCommentReq
(Peer peer, int num) Send comment request(package private) void
PeerCoordinator.sendCommentReq
(Peer peer) Send a commment request message to the peer, if he supports it.static void
Send the DHT port numbers(package private) void
Send a DHT message to the peer, if we both support DHT.(package private) void
Send a PEX message to the peer, if he supports PEX.static void
added.f and dropped unsupportedvoid
Piece.setRequested
(Peer peer, boolean requested) Since 0.8.3, keep track of who is requesting here, to avoid deadlocks from querying each peer.void
Called when a peer has uploaded some bytes of a piece.void
Called when a (partial) piece has been uploaded to the peer.int
Returns one of pieces in the given BitField that is still wanted or -1 if none of the given pieces are wanted.int
Called when we are downloading from the peer and need to ask for a new piece.Modifier and TypeMethodDescriptionstatic void
added.f and dropped unsupportedModifierConstructorDescriptionPeerConnectionIn
(Peer peer, DataInputStream din) PeerConnectionOut
(Peer peer, DataOutputStream dout) (package private)
PeerState
(Peer peer, PeerListener listener, MetaInfo metainfo, PeerConnectionIn in, PeerConnectionOut out)