示例#1
0
            internal async Task SendDataAsync(Memory <byte> data)
            {
                var outputWriter = _pair.Application.Output;
                var frame        = new Http3Frame();

                frame.PrepareData();
                frame.Length = data.Length;
                Http3FrameWriter.WriteHeader(frame, outputWriter);
                await SendAsync(data.Span);
            }
示例#2
0
            public async Task <bool> SendHeadersAsync(IEnumerable <KeyValuePair <string, string> > headers)
            {
                var outputWriter = _pair.Application.Output;
                var frame        = new Http3Frame();

                frame.PrepareHeaders();
                var buffer = _headerEncodingBuffer.AsMemory();
                var done   = _qpackEncoder.BeginEncode(headers, buffer.Span, out var length);

                frame.Length = length;
                // TODO may want to modify behavior of input frames to mock different client behavior (client can send anything).
                Http3FrameWriter.WriteHeader(frame, outputWriter);
                await SendAsync(buffer.Span.Slice(0, length));

                return(done);
            }