예제 #1
0
 private bool InChannelMessageReceived(byte[] data)
 {
     try
     {
         ReceivedMessages.Inc(1);
         ReceivedBytes.Inc((ulong)data.GetLength(0));
         var message = (OpaqueMessage.OpaqueMessage)GZip.DecompressAndDeserialize(data);
         if (message == null)
         {
             return(false);
         }
         _dispatcher.Dispatch(message);
         var outbuff = GZip.SerializeAndCompress(new OpaqueMessageReply(message));
         _outChannel.Send(outbuff);
         SentBytes.Inc((ulong)outbuff.GetLength(0));
         return(true);
     }
     catch (Exception e)
     {
         STrace.Exception(GetType().FullName, e);
     }
     return(false);
 }