Example #1
0
            /// <exception cref="System.Exception"/>
            public override void MessageReceived(ChannelHandlerContext ctx, MessageEvent e)
            {
                ChannelBuffer buf  = (ChannelBuffer)e.GetMessage();
                ByteBuffer    b    = buf.ToByteBuffer().AsReadOnlyBuffer();
                XDR           @in  = new XDR(b, XDR.State.Reading);
                RpcInfo       info = null;

                try
                {
                    RpcCall       callHeader = RpcCall.Read(@in);
                    ChannelBuffer dataBuffer = ChannelBuffers.WrappedBuffer(@in.Buffer().Slice());
                    info = new RpcInfo(callHeader, dataBuffer, ctx, e.GetChannel(), e.GetRemoteAddress
                                           ());
                }
                catch (Exception)
                {
                    Log.Info("Malformed RPC request from " + e.GetRemoteAddress());
                }
                if (info != null)
                {
                    Channels.FireMessageReceived(ctx, info);
                }
            }