@Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { super.sessionIdle(session, status); // 如果IoSession闲置,则关闭连接 if (status == IdleStatus.BOTH_IDLE) { session.write(HEARTBEATRESPONSE); } }
@Override public void sessionIdle(IoSession session, IdleStatus status) throws Exception { log.debug("IDLE " + session.getIdleCount(status)); super.sessionIdle(session, status); }