| 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. |
| Modifier and Type | Class and Description |
|---|---|
(package private) class | WebPeerBEP 19. |
| Modifier and Type | Field and Description |
|---|---|
(package private) Deque<Peer> | PeerCoordinator.peerssynchronize on this when changing peers or downloaders. |
| Modifier and Type | Method and Description |
|---|---|
List<Peer> | Snark.getPeerList()Get the peer list. |
Set<Peer> | TrackerInfo.getPeers() |
List<Peer> | PeerCoordinator.peerList()Returns a snapshot of the connected peers list for web page detailed stats. |
| Modifier and Type | Method and Description |
|---|---|
boolean | Piece.addPeer(Peer peer)Adds a peer to the set of peers that have this piece. |
boolean | PeerCoordinator.addPeer(Peer peer)Add peer (inbound or outbound) |
int | Peer.compareTo(Peer p)Compares this peer to another by PeerID, then by internal ID. |
void | PeerListener.connected(Peer peer)Called when the connection to the peer has started and the handshake was successfull. |
void | PeerCoordinator.connected(Peer peer)Called when a peer connection is established. |
void | PeerListener.disconnected(Peer peer)Called when the connection to the peer was terminated or the connection handshake failed. |
void | PeerCoordinator.disconnected(Peer peer)Called when a peer disconnects. |
PartialPiece | 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 task |
PartialPiece | PeerCoordinator.getPartialPiece(Peer peer,
BitField havePieces)Return partial piece to the PeerState if it's still wanted and peer has it. |
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)Called when a choke message is received. |
void | PeerListener.gotCommentReq(Peer peer,
int num)Called when comments are requested via ut_comment |
void | PeerCoordinator.gotCommentReq(Peer peer,
int num)Called when comments are requested via ut_comment |
void | PeerListener.gotComments(Peer peer,
List<Comment> comments)Called when comments are received via ut_comment |
void | PeerCoordinator.gotComments(Peer peer,
List<Comment> comments)Called when comments are received via ut_comment |
void | PeerListener.gotExtension(Peer peer,
int id,
byte[] bs)Called when an extension message is received. |
void | PeerCoordinator.gotExtension(Peer peer,
int id,
byte[] bs)PeerListener callback |
boolean | PeerListener.gotHave(Peer peer,
int piece)Called when a have piece message is received. |
boolean | PeerCoordinator.gotHave(Peer peer,
int piece) |
void | PeerListener.gotInterest(Peer peer,
boolean interest)Called when an interested message is received. |
void | PeerCoordinator.gotInterest(Peer peer,
boolean interest)Called when an interested message is received. |
void | PeerListener.gotPeers(Peer peer,
List<PeerID> pIDList)Called when peers are received via PEX |
void | PeerCoordinator.gotPeers(Peer peer,
List<PeerID> peers)Get peers from PEX - PeerListener callback |
boolean | PeerListener.gotPiece(Peer peer,
PartialPiece piece)Called when a piece is received from the peer. |
boolean | PeerCoordinator.gotPiece(Peer peer,
PartialPiece pp)Returns false if the piece is no good (according to the hash). |
void | PeerListener.gotPort(Peer peer,
int port,
int rport)Called when a DHT port message is received. |
void | PeerCoordinator.gotPort(Peer peer,
int port,
int rport)PeerListener callback Tell the DHT to ping it, this will get back the node info |
ByteArray | PeerListener.gotRequest(Peer peer,
int piece,
int off,
int len)Called when the peer wants (part of) a piece from us. |
ByteArray | 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. |
static void | ExtensionHandler.handleMessage(Peer peer,
PeerListener listener,
int id,
byte[] bs)Handles an incoming extension message from a peer. |
boolean | Piece.isRequestedBy(Peer peer)Checks if the given peer is currently requesting this piece. |
static void | ExtensionHandler.locked_sendComments(Peer peer,
int num,
CommentSet comments)Sends comments to a peer. |
boolean | PeerListener.needPiece(Peer peer,
BitField bitfield)Called when we are downloading from the peer and may need to ask for a new piece. |
boolean | PeerCoordinator.needPiece(Peer peer,
BitField havePieces)Called when we are downloading from the peer and may need to ask for a new piece. |
void | Snark.peerChange(PeerCoordinator coordinator,
Peer peer)CoordinatorListener no-op |
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)Removes a peer from those that have this piece. |
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 save |
void | PeerCoordinator.savePartialPieces(Peer peer,
List<Request> partials)Save partial pieces on peer disconnection and hopefully restart it later. |
(package private) void | PeerCoordinator.sendCommentReq(Peer peer)Send a commment request message to the peer, if he supports it. |
static void | ExtensionHandler.sendCommentReq(Peer peer,
int num)Sends a comment request to a peer. |
(package private) void | PeerCoordinator.sendDHT(Peer peer)Send a DHT message to the peer, if we both support DHT. |
static void | ExtensionHandler.sendDHT(Peer peer,
int qport,
int rport)Sends DHT port numbers to a peer. |
(package private) void | PeerCoordinator.sendPeers(Peer peer)Send a PEX message to the peer, if he supports PEX. |
static void | ExtensionHandler.sendPEX(Peer peer,
List<Peer> pList)Sends a PEX message with the given peer list. |
void | Piece.setRequested(Peer peer,
boolean requested)Marks a peer as requesting or no longer requesting this piece. |
boolean | BandwidthListener.shouldRequest(Peer peer,
int size)Checks if we should request the given number of bytes from a peer. |
boolean | Peer.shouldRequest(Peer peer,
int size)Should we request this many bytes? |
boolean | BandwidthManager.shouldRequest(Peer peer,
int size)Should we request this many bytes? |
boolean | PeerCoordinator.shouldRequest(Peer peer,
int size)Should we request this many bytes? |
| Modifier and Type | Method and Description |
|---|---|
static void | ExtensionHandler.sendPEX(Peer peer,
List<Peer> pList)Sends a PEX message with the given peer list. |
| Constructor and Description |
|---|
PeerConnectionIn(Peer peer,
DataInputStream din)Create a handler for incoming messages from a peer. |
PeerConnectionOut(Peer peer,
DataOutputStream dout)Creates a new outgoing connection handler. |
PeerState(Peer peer,
PeerListener listener,
BandwidthListener bwl,
MetaInfo metainfo,
PeerConnectionIn in,
PeerConnectionOut out) |