@Override public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { Session session = new Session(ctx.getChannel()); netHandler.onConnected(session); ctx.setAttachment(session); }