public class RelayRPC extends DispatchHandler
| Modifier and Type | Method and Description |
|---|---|
FutureResponse |
forwardMessage(PeerConnection peerConnection,
Buffer buf)
Forward a message through the open peer connection to the unreachable
peer.
|
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder) |
FutureResponse |
sendPeerMap(PeerAddress peerAddress,
List<Map<Number160,PeerStatatistic>> map,
FutureChannelCreator fcc)
Send the peer map of an unreachable peer to a relay peer, so that the
relay peer can reply to neighbor requests on behalf of the unreachable
peer.
|
static RelayRPC |
setup(Peer peer)
Register the RelayRPC.
|
FutureDone<PeerConnection> |
setupRelay(ChannelCreator channelCreator,
FuturePeerConnection fpc)
Set up a relay connection to a peer.
|
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, signpublic static RelayRPC setup(Peer peer)
peer - The peer to register the RelayRPCpublic FutureResponse sendPeerMap(PeerAddress peerAddress, List<Map<Number160,PeerStatatistic>> map, FutureChannelCreator fcc)
peerAddress - The peer address of the relay peermap - The unreachable peer's peer map.fcc - public FutureResponse forwardMessage(PeerConnection peerConnection, Buffer buf)
peerConnection - The open connection to the unreachable peerbuf - Buffer of the message that needs to be forwarded to the
unreachable peerpublic FutureDone<PeerConnection> setupRelay(ChannelCreator channelCreator, FuturePeerConnection fpc)
channelCreator - fpcshall - FuturePeerConnection to the peer that shall act as a relay.public void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws Exception
handleResponse in class DispatchHandlerExceptionCopyright © 2014. All rights reserved.