K - The type of future to handlepublic class RequestHandler<K extends FutureResponse> extends io.netty.channel.SimpleChannelInboundHandler<Message>
RequestHandlerTCP, which is used for TCP.| Constructor and Description |
|---|
RequestHandler(K futureResponse,
PeerBean peerBean,
ConnectionBean connectionBean,
ConnectionConfiguration configuration)
Create a request handler that can send UDP messages.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Message responseMessage) |
ConnectionBean |
connectionBean() |
int |
connectionTimeoutTCPMillis() |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
K |
fireAndForgetBroadcastUDP(ChannelCreator channelCreator)
Broadcast a UDP message (layer 2) and do not expect a reply.
|
K |
fireAndForgetUDP(ChannelCreator channelCreator)
Send a UDP message and don't expect a reply.
|
K |
futureResponse() |
int |
idleTCPSeconds() |
int |
idleUDPSeconds() |
PeerBean |
peerBean() |
K |
sendBroadcastUDP(ChannelCreator channelCreator)
Broadcast a UDP message (layer 2) and expect a reply.
|
K |
sendTCP(ChannelCreator channelCreator)
Send a TCP message and expect a reply.
|
K |
sendTCP(ChannelCreator channelCreator,
PeerConnection peerConnection)
Send a TCP message and expect a reply.
|
K |
sendTCP(PeerConnection peerConnection) |
K |
sendUDP(ChannelCreator channelCreator)
Send a UDP message and expect a reply.
|
int |
slowResponseTimeoutSeconds() |
acceptInboundMessage, channelReadchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredhandlerAdded, handlerRemoved, isSharablepublic RequestHandler(K futureResponse, PeerBean peerBean, ConnectionBean connectionBean, ConnectionConfiguration configuration)
futureResponse - The future that will be called when we get an answerpeerBean - The peer beanconnectionBean - The connection beanconfiguration - the client side connection configurationpublic K futureResponse()
public PeerBean peerBean()
public ConnectionBean connectionBean()
public int idleTCPSeconds()
public int idleUDPSeconds()
public int connectionTimeoutTCPMillis()
public int slowResponseTimeoutSeconds()
public K sendUDP(ChannelCreator channelCreator)
channelCreator - The channel creator will create a UDP connectionpublic K fireAndForgetUDP(ChannelCreator channelCreator)
channelCreator - The channel creator will create a UDP connectionpublic K sendBroadcastUDP(ChannelCreator channelCreator)
channelCreator - The channel creator will create a UDP connectionpublic K fireAndForgetBroadcastUDP(ChannelCreator channelCreator)
channelCreator - The channel creator will create a UDP connectionpublic K sendTCP(ChannelCreator channelCreator)
channelCreator - The channel creator will create a TCP connectionpublic K sendTCP(PeerConnection peerConnection)
public K sendTCP(ChannelCreator channelCreator, PeerConnection peerConnection)
channelCreator - The channel creator will create a TCP connectionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2014. All rights reserved.