public class Sender extends Object
| Constructor and Description |
|---|
Sender(Number160 peerId,
List<PeerStatusListener> peerStatusListeners,
ChannelClientConfiguration channelClientConfiguration,
Dispatcher dispatcher,
SendBehavior sendBehavior,
PeerBean peerBean)
Creates a new sender with the listeners for offline peers.
|
| Modifier and Type | Method and Description |
|---|---|
ConcurrentHashMap<Integer,FutureResponse> |
cachedRequests()
Get currently cached requests.
|
ChannelClientConfiguration |
channelClientConfiguration() |
PingBuilderFactory |
pingBuilderFactory() |
Sender |
pingBuilderFactory(PingBuilderFactory pingBuilderFactory) |
void |
sendSelf(FutureResponse futureResponse,
Message message)
In case a message is sent to the sender itself, this is the cutoff.
|
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, List<PeerStatusListener> peerStatusListeners, ChannelClientConfiguration channelClientConfiguration, Dispatcher dispatcher, SendBehavior sendBehavior, PeerBean peerBean)
peerStatusListeners - The listener for offline peerschannelClientConfiguration - The configuration used to get the signature factorydispatcher - concurrentHashMap - 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 sendSelf(FutureResponse futureResponse, Message message)
futureResponse - the future to respond as soon as the proper handler returns itmessage - the requestpublic 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 broadcastpublic ConcurrentHashMap<Integer,FutureResponse> cachedRequests()
Copyright © 2014. All rights reserved.