Ejemplo n.º 1
0
        internal static List <ArraySegment <byte> > GetResponseData(OutgoingResponseFrame frame, int requestId)
        {
            byte[] headerData = new byte[HeaderSize + 4];
            ReplyHeader.CopyTo(headerData.AsSpan());

            OutputStream.WriteSize20(frame.Size + HeaderSize + 4, headerData.AsSpan(10, 4));
            OutputStream.WriteInt(requestId, headerData.AsSpan(HeaderSize, 4));

            var data = new List <ArraySegment <byte> >()
            {
                headerData
            };

            data.AddRange(frame.Data);
            return(data);
        }
Ejemplo n.º 2
0
        internal static List <ArraySegment <byte> > GetRequestData(OutgoingRequestFrame frame, long streamId)
        {
            byte[] headerData = new byte[HeaderSize + 4];
            RequestHeader.CopyTo(headerData.AsSpan());

            OutputStream.WriteSize20(frame.Size + HeaderSize + 4, headerData.AsSpan(10, 4));
            // TODO: Fix to support long streamId
            OutputStream.WriteInt((int)streamId, headerData.AsSpan(HeaderSize, 4));

            var data = new List <ArraySegment <byte> >()
            {
                headerData
            };

            data.AddRange(frame.Data);
            return(data);
        }