Example usage for io.netty.handler.timeout IdleStateHandler getWriterIdleTimeInMillis

List of usage examples for io.netty.handler.timeout IdleStateHandler getWriterIdleTimeInMillis

Introduction

In this page you can find the example usage for io.netty.handler.timeout IdleStateHandler getWriterIdleTimeInMillis.

Prototype

public long getWriterIdleTimeInMillis() 

Source Link

Document

Return the writerIdleTime that was given when instance this class in milliseconds.

Usage

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);
}