public class PeerExchangeRPC extends ReplyHandler
Modifier and Type | Field and Description |
---|---|
static int |
SENT_PEERS_CACHE_SIZE |
Constructor and Description |
---|
PeerExchangeRPC(PeerBean peerBean,
ConnectionBean connectionBean) |
Modifier and Type | Method and Description |
---|---|
Message |
handleResponse(Message message,
boolean sign)
If the message is OK, that has been previously checked by the user using
checkMessage, a reply to the message is generated here.
|
FutureResponse |
peerExchange(PeerAddress remotePeer,
Number160 locationKey,
Number160 domainKey,
boolean isReplication,
ChannelCreator channelCreator,
boolean forceTCP)
Peer exchange (PEX) information about other peers from the swarm, to not
ask the primary trackers too often.
|
createMessage, createResponseMessage, exceptionCaught, forwardMessage, getConnectionBean, getPeerBean, registerIoHandler, setSignReply
bindRequested, channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, closeRequested, connectRequested, disconnectRequested, handleDownstream, handleUpstream, messageReceived, setInterestOpsRequested, unbindRequested, writeComplete, writeRequested
public static final int SENT_PEERS_CACHE_SIZE
public PeerExchangeRPC(PeerBean peerBean, ConnectionBean connectionBean)
public FutureResponse peerExchange(PeerAddress remotePeer, Number160 locationKey, Number160 domainKey, boolean isReplication, ChannelCreator channelCreator, boolean forceTCP)
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 Message handleResponse(Message message, boolean sign) throws Exception
ReplyHandler
handleResponse
in class ReplyHandler
message
- Request messageException
Copyright © 2013. All Rights Reserved.