List of usage examples for io.netty.handler.timeout IdleStateHandler getWriterIdleTimeInMillis
public long getWriterIdleTimeInMillis()
From source file:org.apache.tajo.rpc.MonitorClientHandler.java
License:Apache License
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { // Initialize the message. ping = ctx.alloc().buffer(RpcConstants.PING_PACKET.length()) .writeBytes(RpcConstants.PING_PACKET.getBytes(Charset.defaultCharset())); IdleStateHandler handler = ctx.pipeline().get(IdleStateHandler.class); if (handler != null && handler.getWriterIdleTimeInMillis() > 0) { enableMonitor = true;/* www .j a v a 2 s . c o m*/ } super.channelActive(ctx); }