Exemplo n.º 1
0
 @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();
 }
Exemplo n.º 2
0
 @Override
 public void channelInactive(ChannelHandlerContext ctx) {
   Session session = this.session.get();
   session.onDisconnect();
 }