From 21c5cfdb5cbca68396aab96803863a74db2f601d Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 13 Oct 2018 15:11:38 +0530 Subject: [PATCH] platform not supported issue handled. --- DnsServerCore/DnsServer.cs | 17 +++++++++++++++-- DnsServerCore/DnsWebService.cs | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/DnsServerCore/DnsServer.cs b/DnsServerCore/DnsServer.cs index b07a4046..fe086162 100644 --- a/DnsServerCore/DnsServer.cs +++ b/DnsServerCore/DnsServer.cs @@ -754,9 +754,22 @@ namespace DnsServerCore _state = ServiceState.Stopping; for (int i = 0; i < UDP_LISTENER_THREAD_COUNT; i++) - _udpListenerThreads[i].Abort(); + { + try + { + _udpListenerThreads[i].Abort(); + } + catch (PlatformNotSupportedException) + { } + } - _tcpListenerThread.Abort(); + + try + { + _tcpListenerThread.Abort(); + } + catch (PlatformNotSupportedException) + { } _udpListener.Dispose(); _tcpListener.Dispose(); diff --git a/DnsServerCore/DnsWebService.cs b/DnsServerCore/DnsWebService.cs index fb561288..fd40eb83 100644 --- a/DnsServerCore/DnsWebService.cs +++ b/DnsServerCore/DnsWebService.cs @@ -3259,7 +3259,12 @@ namespace DnsServerCore _state = ServiceState.Stopping; - _webServiceThread.Abort(); + try + { + _webServiceThread.Abort(); + } + catch (PlatformNotSupportedException) + { } _webService.Stop(); _dnsServer.Stop();