public class Sender extends Object
| Constructor and Description |
|---|
Sender(Number160 peerId,
PeerStatusListener[] peerStatusListeners,
ChannelClientConfiguration channelClientConfiguration,
Dispatcher dispatcher)
Creates a new sender with the listeners for offline peers.
|
| Modifier and Type | Method and Description |
|---|---|
ChannelClientConfiguration |
channelClientConfiguration() |
PingBuilderFactory |
pingBuilderFactory() |
Sender |
pingBuilderFactory(PingBuilderFactory pingBuilderFactory) |
void |
sendTCP(io.netty.channel.SimpleChannelInboundHandler<Message> handler,
FutureResponse futureResponse,
Message message,
ChannelCreator channelCreator,
int idleTCPSeconds,
int connectTimeoutMillis,
PeerConnection peerConnection)
Send a message via TCP.
|
void |
sendUDP(io.netty.channel.SimpleChannelInboundHandler<Message> handler,
FutureResponse futureResponse,
Message message,
ChannelCreator channelCreator,
int idleUDPSeconds,
boolean broadcast)
Send a message via UDP.
|
public Sender(Number160 peerId, PeerStatusListener[] peerStatusListeners, ChannelClientConfiguration channelClientConfiguration, Dispatcher dispatcher)
peerStatusListeners - The listener for offline peerschannelClientConfiguration - The configuration used to get the signature factorydispatcher - public ChannelClientConfiguration channelClientConfiguration()
public PingBuilderFactory pingBuilderFactory()
public Sender pingBuilderFactory(PingBuilderFactory pingBuilderFactory)
public void sendTCP(io.netty.channel.SimpleChannelInboundHandler<Message> handler, FutureResponse futureResponse, Message message, ChannelCreator channelCreator, int idleTCPSeconds, int connectTimeoutMillis, PeerConnection peerConnection)
handler - The handler to deal with a reply messagefutureResponse - The future to set the responsemessage - The message to sendchannelCreator - The channel creator for the UPD channelidleTCPSeconds - The idle time of a message until we failconnectTimeoutMillis - The idle we set for the connection setuppublic void sendUDP(io.netty.channel.SimpleChannelInboundHandler<Message> handler, FutureResponse futureResponse, Message message, ChannelCreator channelCreator, int idleUDPSeconds, boolean broadcast)
handler - The handler to deal with a reply messagefutureResponse - The future to set the responsemessage - The message to sendchannelCreator - The channel creator for the UPD channelidleUDPSeconds - The idle time of a message until we failbroadcast - True to send via layer 2 broadcastCopyright © 2014. All rights reserved.