@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleState) {
IdleState e = (IdleState) evt;
if (e == IdleState.READER_IDLE || e == IdleState.WRITER_IDLE) {
LOG.log(Level.FINE, "Closing idle channel: {}", e);
ctx.close();
}
}