我运行了这段代码:
logger.trace("Idle command timeout for command " + tag + " ; closing connection");
session.close(true);
但是这段代码无法运行:
private static class Handler extends IoHandlerAdapter {
@Override
public void sessionClosed(IoSession session) throws Exception {
ImapClient client = (ImapClient) session.getAttribute(ClientKey);
connectionLogger.trace("Session closed");
logger.trace("Session closed");
这种情况只在某些时候发生,并且自从MINA 2.0.4升级到MINA 2.0.7后就发生了。可能是一个错误,但任何想法如何调试或隔离它?
答案 0 :(得分:2)
我建议你也覆盖 exceptionCaught 以确保你没有错过强制关闭异常。
http://mina.apache.org/mina-project/apidocs/org/apache/mina/core/service/IoHandlerAdapter.html