示例#1
0
        public override GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null)
        {
            var loopbackServer = new LoopbackServer(CreateOptions(options));

            Task.WaitAll(loopbackServer.ListenAsync());
            return(loopbackServer);
        }
示例#2
0
 public static async Task CreateServerAsync(Func <LoopbackServer, Task> funcAsync, Options options = null)
 {
     using (var server = new LoopbackServer(options))
     {
         await server.ListenAsync();
         await funcAsync(server).ConfigureAwait(false);
     }
 }