|
|
@ -40,7 +40,13 @@ public class EchoSessionListener implements SessionListener {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void sessionClosed(Session session) {
|
|
|
|
public void sessionClosed(Session session) {
|
|
|
|
logger.info("sessionCreated: {}", session);
|
|
|
|
logger.info("sessionClosed: {}", session);
|
|
|
|
|
|
|
|
if (session.getIoSession().getRemoteAddress() instanceof InetSocketAddress) {
|
|
|
|
|
|
|
|
InetSocketAddress remoteAddress = (InetSocketAddress) session.getIoSession().getRemoteAddress();
|
|
|
|
|
|
|
|
String remoteIpAddress = remoteAddress.getAddress().getHostAddress();
|
|
|
|
|
|
|
|
logger.info("removing session: {} -> {}", remoteIpAddress, remoteSessionMapping.get(remoteIpAddress));
|
|
|
|
|
|
|
|
remoteSessionMapping.remove(remoteIpAddress);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|