public class HeartBeat
extends io.netty.channel.ChannelDuplexHandler
| Constructor and Description |
|---|
HeartBeat(long allIdleTime,
TimeUnit unit,
PingBuilderFactory pingBuilderFactory)
Creates a new instance firing
IdleStateEvents. |
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
channelRegistered(io.netty.channel.ChannelHandlerContext ctx) |
long |
getAllIdleTimeInMillis()
Return the allIdleTime that was given when instance this class in milliseconds.
|
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
PeerConnection |
peerConnection() |
HeartBeat |
peerConnection(PeerConnection peerConnection) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, readchannelReadComplete, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredpublic HeartBeat(long allIdleTime,
TimeUnit unit,
PingBuilderFactory pingBuilderFactory)
IdleStateEvents.allIdleTime - a ping will be triggered when neither
read nor write was performed for the specified period of time. Specify 0 to disable.unit - the TimeUnit of readerIdleTime, writeIdleTime, and allIdleTimepingBuilderFactory - the pingBuilderFactorypublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void write(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
io.netty.channel.ChannelPromise promise)
throws Exception
write in interface io.netty.channel.ChannelOutboundHandlerwrite in class io.netty.channel.ChannelDuplexHandlerExceptionpublic long getAllIdleTimeInMillis()
public PeerConnection peerConnection()
public HeartBeat peerConnection(PeerConnection peerConnection)
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelRegistered in interface io.netty.channel.ChannelInboundHandlerchannelRegistered in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterExceptionCopyright © 2014. All rights reserved.