@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { if(e.getState() == IdleState.ALL_IDLE){ LOG.warn("Channel {} has been idle, it will be disconnected now: ",e.getChannel()); e.getChannel().close(); } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { if (e.getState() == IdleState.WRITER_IDLE && enabledTimeout) { e.getChannel().close(); } } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { // Close idle UdpChildChannel (on server side) or NioDatagramChannel (client side) e.getChannel().close(); } }
public class IdleStateAwareHandler extends IdleStateAwareChannelHandler { @Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { if (e.getState() == IdleState.READER_IDLE) { e.getChannel().write("heartbeat-reader_idle"); } else if (e.getState() == IdleState.WRITER_IDLE) { Logger.getLogger(IdleStateAwareHandler.class.getName()).log( Level.WARNING, "WriteIdle detected, closing channel"); e.getChannel().close(); e.getChannel().write("heartbeat-writer_idle"); } else if (e.getState() == IdleState.ALL_IDLE) { e.getChannel().write("heartbeat-all_idle"); } } }
@Override public void channelIdle(final ChannelHandlerContext ctx, final IdleStateEvent e) throws Exception { final OFMessage m = BasicFactory.getInstance().getMessage( OFType.ECHO_REQUEST); e.getChannel().write(Collections.singletonList(m)); }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { OFFactory factory = (ofVersion == OFVersion.OF_13) ? factory13 : factory10; OFMessage m = factory.buildEchoRequest().build(); log.debug("Sending Echo Request on idle channel: {}", e.getChannel().getPipeline().getLast().toString()); e.getChannel().write(Collections.singletonList(m)); // XXX S some problems here -- echo request has no transaction id, and // echo reply is not correlated to the echo request. }
@Override public void channelIdle(final ChannelHandlerContext ctx, final IdleStateEvent e) throws Exception { final OFMessage m = BasicFactory.getInstance().getMessage( OFType.ECHO_REQUEST); e.getChannel().write(Collections.singletonList(m)); }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { if (e.getState() == IdleState.ALL_IDLE) { idle_connections_closed.increment(); LOG.info("Closing idle connection to HBase region server: " + e.getChannel()); // RegionClientPipeline's disconnect method will handle cleaning up // any outstanding RPCs and removing the client from caches try { e.getChannel().close(); } catch (Exception ex) { // This handler may be called after a channel has entered an odd state // or already been closed. If it has been closed properly, then ignore // the exception, otherwise throw it. if (!(ex instanceof ClosedChannelException)) { throw ex; } } } } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { if (e.getState() == IdleState.WRITER_IDLE && enabledTimeout) { e.getChannel().close(); } } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { if (e.getState() == IdleState.ALL_IDLE) { e.getChannel().close(); } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { if (e.getState() == IdleState.WRITER_IDLE && enabledTimeout) { e.getChannel().close(); } } }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { if (e.getState().equals(IdleState.WRITER_IDLE)) { e.getChannel().write(ChannelBuffers.wrappedBuffer("* OK Hang in there..\r\n".getBytes("US-ASCII"))); } super.channelIdle(ctx, e); }
@Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { LOG.info("closing {} channel after {} event was intercepted", channelName, e.getState().toString()); e.getChannel().close().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { LOG.info("{} channel closed cleanly", channelName); } else { LOG.info("{} channel failed to close cleanly", channelName); } } }); }
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) { if (e.getState() == IdleState.READER_IDLE) { e.getChannel().close(); } else if (e.getState() == IdleState.WRITER_IDLE) { e.getChannel().write(new PingMessage());