阿帕奇米娜 - 2.0.1
我有一个 IoHandlerAdapter,它对 sessionOpened 和 sessionClosed 有回调。当我打开一个会话时,我登录到服务器并开始发送请求,在“sessionClosed”中我只是重新启动我的应用程序。
我的应用程序进行检查
if(!session.isClosing()) {
//write to socket
} else {
//throw a runtime exception. Hopefully the sessionClosed API gets
//called soon and the next time this call will succeed.
}
但是我确实注意到,尽管 session.isClosing() 返回 true,但实际上会话永远不会关闭。即,我并没有真正在我的处理程序中得到回电。这可能吗?我怎样才能减轻这种风险。有人可以解释调用关闭回调需要多长时间吗?