public static async Task CreateServerAsync(Func <Http2LoopbackServer, Uri, Task> funcAsync, int millisecondsTimeout = 60_000)
 {
     using (var server = Http2LoopbackServer.CreateServer())
     {
         await funcAsync(server, server.Address).TimeoutAfter(millisecondsTimeout).ConfigureAwait(false);
     }
 }
Example #2
0
 public static async Task CreateServerAsync(Func <Http2LoopbackServer, Uri, Task> funcAsync, int millisecondsTimeout = 60_000)
 {
     using (var server = Http2LoopbackServer.CreateServer())
     {
         await funcAsync(server, server.Address).WaitAsync(TimeSpan.FromMilliseconds(millisecondsTimeout));
     }
 }
Example #3
0
        public static async Task CreateClientAndServerAsync(Func <Uri, Task> clientFunc, Func <Http2LoopbackServer, Task> serverFunc, Http2Options http2Options, int timeout = 60_000)
        {
            using (var server = Http2LoopbackServer.CreateServer(http2Options ?? new Http2Options()))
            {
                Task clientTask = clientFunc(server.Address);
                Task serverTask = serverFunc(server);

                await new Task[] { clientTask, serverTask }.WhenAllOrAnyFailed(timeout).ConfigureAwait(false);
            }
        }
Example #4
0
        public async static Task CreateClientAndServerAsync(Func <Uri, Task> clientFunc, Func <Http2LoopbackServer, Task> serverFunc, int timeout = 60_000)
        {
            using (var server = Http2LoopbackServer.CreateServer())
            {
                Task clientTask = clientFunc(server.Address);
                Task serverTask = serverFunc(server);

                await new Task[] { clientTask, serverTask }.WhenAllOrAnyFailed(timeout);
            }
        }
        public override GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null)
        {
            Http2Options http2Options = new Http2Options();

            if (options != null)
            {
                http2Options.Address      = options.Address;
                http2Options.UseSsl       = options.UseSsl;
                http2Options.SslProtocols = options.SslProtocols;
            }

            return(Http2LoopbackServer.CreateServer(http2Options));
        }
Example #6
0
 public override GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null)
 {
     return(Http2LoopbackServer.CreateServer(CreateOptions(options)));
 }