예제 #1
0
 protected override void Decode(IChannelHandlerContext context, IByteBuffer message, List <object> output)
 {
     try
     {
         var baseMessage = GkParser.Decode(message);
         output.Add(baseMessage);
     }
     finally
     {
         // message.SafeRelease();
     }
 }
예제 #2
0
        protected override void Decode(IChannelHandlerContext context, DatagramPacket message, List <object> output)
        {
            try
            {
                if (message is DatagramPacket packet)
                {
                    var buffer      = packet.Content;
                    var baseMessage = GkParser.Decode(buffer);
//                    var baseUdpMsg = (BaseUdpMessage)baseMessage;
                    var baseUdpMsg = new BaseUdpMessage(baseMessage, packet.Recipient);
                    output.Add(baseUdpMsg);
                }
            }
            finally
            {
                // message.SafeRelease();
            }
        }