ignoring ObjectDisposedException when server stops.

This commit is contained in:
Shreyas Zare
2020-12-25 19:49:44 +05:30
parent 9b5af167d0
commit 09fc300508
3 changed files with 13 additions and 1 deletions

View File

@@ -202,7 +202,7 @@ namespace DnsServerCore.Dhcp
}
catch (ObjectDisposedException)
{
//socket disposed
//server stopped
}
catch (SocketException ex)
{

View File

@@ -374,6 +374,10 @@ namespace DnsServerCore.Dns
if (log != null)
log.Write(localEP, protocol, ex);
}
catch (ObjectDisposedException)
{
//server stopped
}
catch (Exception ex)
{
if ((_state == ServiceState.Stopping) || (_state == ServiceState.Stopped))

View File

@@ -217,6 +217,10 @@ namespace DnsServerCore
_log.Write(ex);
}
catch (ObjectDisposedException)
{
//web service stopped
}
catch (Exception ex)
{
if ((_state == ServiceState.Stopping) || (_state == ServiceState.Stopped))
@@ -244,6 +248,10 @@ namespace DnsServerCore
_log.Write(ex);
}
catch (ObjectDisposedException)
{
//web service stopped
}
catch (Exception ex)
{
if ((_state == ServiceState.Stopping) || (_state == ServiceState.Stopped))