}
@Override
public void channelActive(ChannelHandlerContext ctx) {
final Channel c = ctx.channel();
Session s = connectionManager.newSession(c);
if (!session.compareAndSet(null, s)) {
throw new IllegalStateException("Session may not be set more than once");
}
s.onReady();
}