Ejemplo n.º 1
0
 protected override void Decode(IChannelHandlerContext context, IByteBuffer input, List <object> output)
 {
     try{
         var buffer = GkParser.Split(input);
         if (buffer == null)
         {
             return;
         }
         output.Add(buffer);
     }
     finally
     {
         ResetBuffer(input);
     }
 }
Ejemplo n.º 2
0
        protected override void Decode(IChannelHandlerContext context, DatagramPacket message, List <object> output)
        {
            Logger.Info("FrameSplitDecoder 收到server端消息");
            var input = message.Content;

            try
            {
                var buffer = GkParser.Split(input);
                if (buffer == null)
                {
                    return;
                }
                output.Add(new DatagramPacket(buffer, message.Sender));
            }
            finally
            {
                ResetBuffer(input);
            }
        }