Beispiel #1
0
 @Override
 public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) {
   final NioSocketChannel ch = (NioSocketChannel) e.getChannel();
   final DefaultNetSocket sock = socketMap.remove(ch);
   if (sock != null) {
     sock.getContext()
         .execute(
             new Runnable() {
               public void run() {
                 sock.handleClosed();
               }
             });
   }
 }
Beispiel #2
0
 @Override
 public void channelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)
     throws Exception {
   final NioSocketChannel ch = (NioSocketChannel) e.getChannel();
   final DefaultNetSocket sock = socketMap.get(ch);
   ChannelState state = e.getState();
   if (state == ChannelState.INTEREST_OPS) {
     sock.getContext()
         .execute(
             new Runnable() {
               public void run() {
                 sock.handleInterestedOpsChanged();
               }
             });
   }
 }