Пример #1
0
        protected override BinaryRequestInfo ResolveRequestInfo(ArraySegment <byte> header, byte[] bodyBuffer, int offset, int length)
        {
            byte[] Name_Byte = header.CloneRange(0, 4);
            string cmd       = BitConverter.ToString(Name_Byte);

            return(new BinaryRequestInfo(Encoding.UTF8.GetString(header.Array, header.Offset, 4), bodyBuffer.CloneRange(offset, length)));
        }
Пример #2
0
 protected override RequestInfo ResolveRequestInfo(ArraySegment <byte> header, byte[] bodyBuffer, int offset, int length)
 => new RequestInfo((KeyType)BitConverter.ToUInt16(header.CloneRange(0, 2), 0), bodyBuffer.CloneRange(offset, length));