示例#1
0
        public override async Task AcceptConnectionAsync(Func <GenericLoopbackConnection, Task> funcAsync)
        {
            using Http3LoopbackConnection con = await EstablishHttp3ConnectionAsync().ConfigureAwait(false);
            await funcAsync(con).ConfigureAwait(false);

            await con.ShutdownAsync();
        }
示例#2
0
        private async Task <Http3LoopbackConnection> EstablishHttp3ConnectionAsync()
        {
            QuicConnection con = await _listener.AcceptConnectionAsync().ConfigureAwait(false);

            Http3LoopbackConnection connection = new Http3LoopbackConnection(con);

            await connection.EstablishControlStreamAsync();

            return(connection);
        }
示例#3
0
        public override async Task <HttpRequestData> HandleRequestAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList <HttpHeaderData> headers = null, string content = "")
        {
            await using Http3LoopbackConnection con = (Http3LoopbackConnection) await EstablishGenericConnectionAsync().ConfigureAwait(false);

            return(await con.HandleRequestAsync(statusCode, headers, content).ConfigureAwait(false));
        }