public override GenericLoopbackServer CreateServer(GenericLoopbackOptions options = null) { var loopbackServer = new LoopbackServer(CreateOptions(options)); Task.WaitAll(loopbackServer.ListenAsync()); return(loopbackServer); }
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); } }