case OPEN:
if (sessionState.isInUse(session)) {
if (logger.isDebugEnabled()) {
logger.debug("Another connection still in open for [{}]", session.sessionId());
}
ctx.writeAndFlush(new CloseFrame(2010, "Another connection still open"));
session.setState(States.INTERRUPTED);
} else {
session.setInuse();
session.setOpenContext(ctx);
sessionState.onOpen(session, ctx);
}
break;
case INTERRUPTED:
ctx.writeAndFlush(new CloseFrame(1002, "Connection interrupted"));
break;
case CLOSED:
ctx.writeAndFlush(new CloseFrame(3000, "Go away!"));
session.resetInuse();
break;
}
}