public class PeerExchangeRPC extends DispatchHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
SENT_PEERS_CACHE_SIZE |
| Constructor and Description |
|---|
PeerExchangeRPC(PeerBean peerBean,
ConnectionBean connectionBean,
PeerExchangeHandler peerExchange) |
| Modifier and Type | Method and Description |
|---|---|
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder) |
FutureResponse |
peerExchange(PeerAddress remotePeer,
Number320 key,
ChannelCreator channelCreator,
TrackerData peers,
ConnectionConfiguration connectionConfiguration)
Peer exchange (PEX) information about other peers from the swarm, to not ask the primary trackers too often.
|
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, register, signpublic static final int SENT_PEERS_CACHE_SIZE
public PeerExchangeRPC(PeerBean peerBean, ConnectionBean connectionBean, PeerExchangeHandler peerExchange)
public FutureResponse peerExchange(PeerAddress remotePeer, Number320 key, ChannelCreator channelCreator, TrackerData peers, ConnectionConfiguration connectionConfiguration)
remotePeer - The remote peer to send this requestlocationKey - The location keydomainKey - The domain keyisReplication - Set to true if the PEX is started as replication. This means that this peer learned that an other peer
is closer and sends tracker information to that peer.channelCreator - The channel creator that creates connectionsforceTCP - Set to true if the communication should be TCP, default is UDPpublic void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws Exception
handleResponse in class DispatchHandlerExceptionCopyright © 2014. All rights reserved.