Fix the null networkHandler in the MessageContext

This commit is contained in:
Christian 2014-05-24 16:54:48 -04:00
parent c3cf12f3b2
commit 2c5fcc6129

View file

@ -28,7 +28,7 @@ public class SimpleChannelHandlerWrapper<REQ extends IMessage, REPLY extends IMe
@Override
protected void channelRead0(ChannelHandlerContext ctx, REQ msg) throws Exception
{
INetHandler iNetHandler = ctx.attr(NetworkRegistry.NET_HANDLER).get();
INetHandler iNetHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get();
MessageContext context = new MessageContext(iNetHandler, side);
REPLY result = messageHandler.onMessage(msg, context);
if (result != null)