public class PingRPC extends DispatchHandler
| Modifier and Type | Field and Description |
|---|---|
static int |
WAIT_TIME |
| Constructor and Description |
|---|
PingRPC(PeerBean peerBean,
ConnectionBean connectionBean)
Creates an new handshake RPC with listeners.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPeerReachableListener(PeerReachable peerReachable) |
void |
addPeerReceivedBroadcastPingListener(PeerReceivedBroadcastPing peerReceivedBroadcastPing) |
FutureResponse |
fireTCP(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a TCP peer, but don't expect an answer.
|
FutureResponse |
fireUDP(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a UDP peer, but don't expect an answer.
|
void |
handleResponse(Message message,
PeerConnection peerConnection,
boolean sign,
Responder responder)
If the message is OK, that has been previously checked by the user using checkMessage, a reply to the message is
generated here.
|
RequestHandler<FutureResponse> |
ping(PeerAddress remotePeer,
ConnectionConfiguration configuration)
Ping with UDP or TCP, but do not send yet.
|
FutureResponse |
pingBroadcastUDP(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a UDP peer using layer 2 broadcast.
|
FutureResponse |
pingTCP(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a TCP peer.
|
FutureResponse |
pingTCPDiscover(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a TCP peer, and find out how the other peer sees us.
|
FutureResponse |
pingTCPProbe(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a TCP peer, and request the other peer to ping us on our public address with a fire and forget message.
|
FutureResponse |
pingUDP(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a UDP peer.
|
FutureResponse |
pingUDPDiscover(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a UDP peer, and find out how the other peer sees us.
|
FutureResponse |
pingUDPProbe(PeerAddress remotePeer,
ChannelCreator channelCreator,
ConnectionConfiguration configuration)
Ping a UDP peer, and request the other peer to ping us on our public address with a fire and forget message.
|
void |
removePeerReachableListener(PeerReachable peerReachable) |
void |
removePeerReceivedBroadcastPingListener(PeerReceivedBroadcastPing peerReceivedBroadcastPing) |
connectionBean, createMessage, createResponseMessage, createResponseMessage, forwardMessage, peerBean, register, register, signpublic static final int WAIT_TIME
public PingRPC(PeerBean peerBean, ConnectionBean connectionBean)
peerBean - The peer beanconnectionBean - The connection beanpublic RequestHandler<FutureResponse> ping(PeerAddress remotePeer, ConnectionConfiguration configuration)
remotePeer - The destination peerpublic FutureResponse pingUDP(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingBroadcastUDP(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingTCP(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse fireUDP(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse fireTCP(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingUDPDiscover(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingTCPDiscover(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingUDPProbe(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic FutureResponse pingTCPProbe(PeerAddress remotePeer, ChannelCreator channelCreator, ConnectionConfiguration configuration)
remotePeer - The destination peerchannelCreator - The channel creator where we create a UPD channelpublic void handleResponse(Message message, PeerConnection peerConnection, boolean sign, Responder responder) throws Exception
DispatchHandlerhandleResponse in class DispatchHandlermessage - Request messagesign - Flag to indicate if message is signedException - Any exceptionpublic void addPeerReachableListener(PeerReachable peerReachable)
public void removePeerReachableListener(PeerReachable peerReachable)
public void addPeerReceivedBroadcastPingListener(PeerReceivedBroadcastPing peerReceivedBroadcastPing)
public void removePeerReceivedBroadcastPingListener(PeerReceivedBroadcastPing peerReceivedBroadcastPing)
Copyright © 2014. All rights reserved.