diff --git a/SimpleHttpServer/HttpServer.cs b/SimpleHttpServer/HttpServer.cs index 4c20c37..bff035f 100644 --- a/SimpleHttpServer/HttpServer.cs +++ b/SimpleHttpServer/HttpServer.cs @@ -46,6 +46,7 @@ public sealed class HttpServer { try { var ctx = await listener.GetContextAsync(); _ = ProcessRequestAsync(ctx); + } catch (HttpListenerException ex) when (ex.ErrorCode == 995) { //The I/O operation has been aborted because of either a thread exit or an application request } catch (Exception ex) { logger.Fatal($"Caught otherwise uncaught exception in GetContextLoop:\n{ex}"); }