Esempio n. 1
0
 private static bool CheckPacketInStream(ArraySegment <byte> buffer, int unitLength, RpcHttpRtsFlags flags, int numberOfCommands)
 {
     while (buffer.Count > 0)
     {
         int num;
         if (RpcHttpPackets.CheckPacket(buffer, unitLength, flags, numberOfCommands, out num))
         {
             return(true);
         }
         if (num == 0)
         {
             break;
         }
         int num2 = buffer.Offset + num;
         int num3 = buffer.Count - num;
         if (num2 > buffer.Array.Length || num3 < 0)
         {
             break;
         }
         buffer = new ArraySegment <byte>(buffer.Array, num2, num3);
     }
     return(false);
 }
Esempio n. 2
0
        public static bool IsPingPacket(ArraySegment <byte> buffer)
        {
            int num;

            return(RpcHttpPackets.CheckPacket(buffer, 20, RpcHttpRtsFlags.Ping, 0, out num));
        }