Example #1
0
        protected override void Encode(IChannelHandlerContext context, RequestPacket message, List <object> output)
        {
            if (message == null || message.PacketType == Const.OneWay)
            {
                return;
            }
            var buf = context.Allocator.Buffer(128);

            buf.WriteInt(0);
            tars.EncodeResponse(buf, message);
            var length = buf.WriterIndex;

            buf.SetWriterIndex(0);
            buf.WriteInt(length);
            buf.SetWriterIndex(length);
            output.Add(buf);
        }