diff --git a/src/Net/HttpServer.cs b/src/Net/HttpServer.cs index 6d1a2ffb..356203c0 100644 --- a/src/Net/HttpServer.cs +++ b/src/Net/HttpServer.cs @@ -224,8 +224,13 @@ public void Stop() private void RequestHandler() { - while (_server.IsListening) + while (true) { + if (_server == null) + { + Thread.Sleep(10); + continue; + } var contextAsyncResult = _server.BeginGetContext((IAsyncResult ar) => { var context = _server.EndGetContext(ar);