Hello all,

My IoHandler.sessionClosed() logs the remote IP address.
It works perfectly with mina 0.8.1 but throws a NPE in 2.0

I can work around it by storing the SocketAddress in the IoSession as an
attribute.

But I was wondering if there are plans to change this behaviour,
or maybe add an beforeSessionClosed() callback to IoHandler ?

At least, I think it should be mentioned in the javadoc.

public void sessionClosed(IoSession session) throws Exception {
   InetSocketAddress address = (InetSocketAddress) session.getRemoteAddress
();
   logger.info("address=" + address.getAddress().getHostAddress());
  ...
}

thanks,
Maarten

Reply via email to