public override async Task AcceptConnectionAsync(Func <GenericLoopbackConnection, Task> funcAsync) { using Http3LoopbackConnection con = await EstablishHttp3ConnectionAsync().ConfigureAwait(false); await funcAsync(con).ConfigureAwait(false); await con.ShutdownAsync(); }
private async Task <Http3LoopbackConnection> EstablishHttp3ConnectionAsync() { QuicConnection con = await _listener.AcceptConnectionAsync().ConfigureAwait(false); Http3LoopbackConnection connection = new Http3LoopbackConnection(con); await connection.EstablishControlStreamAsync(); return(connection); }
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)); }