diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 01:08:18 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 01:08:18 -0500 |
| commit | 5372c0bf23367a82592ab9eb75c2bc9282f1f2f4 (patch) | |
| tree | fd3a0dd58e35652c2f8375ca88ea523fb36402c3 /Emby.Server.Implementations | |
| parent | be390433dda8ec3afcc36b7c70ac78b06333e643 (diff) | |
remove unused property
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 8 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Udp/UdpServer.cs | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 4e7dc8836..322cdf4f0 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -275,7 +275,9 @@ namespace Emby.Server.Implementations.HttpServer { if (_listener != null) { + _logger.Info("Stopping HttpListener..."); _listener.Stop(); + _logger.Info("HttpListener stopped"); } } @@ -713,19 +715,19 @@ namespace Emby.Server.Implementations.HttpServer protected virtual void Dispose(bool disposing) { if (_disposed) return; + base.Dispose(); lock (_disposeLock) { if (_disposed) return; + _disposed = true; + if (disposing) { Stop(); } - - //release unmanaged resources here... - _disposed = true; } } diff --git a/Emby.Server.Implementations/Udp/UdpServer.cs b/Emby.Server.Implementations/Udp/UdpServer.cs index c15e0ee41..79a1e4640 100644 --- a/Emby.Server.Implementations/Udp/UdpServer.cs +++ b/Emby.Server.Implementations/Udp/UdpServer.cs @@ -154,6 +154,9 @@ namespace Emby.Server.Implementations.Udp catch (ObjectDisposedException) { } + catch (OperationCanceledException) + { + } catch (Exception ex) { _logger.ErrorException("Error receiving udp message", ex); @@ -167,6 +170,11 @@ namespace Emby.Server.Implementations.Udp /// <param name="message">The message.</param> private void OnMessageReceived(SocketReceiveResult message) { + if (_isDisposed) + { + return; + } + if (message.RemoteEndPoint.Port == 0) { return; @@ -221,6 +229,11 @@ namespace Emby.Server.Implementations.Udp public async Task SendAsync(byte[] bytes, IpEndPointInfo remoteEndPoint) { + if (_isDisposed) + { + throw new ObjectDisposedException(GetType().Name); + } + if (bytes == null) { throw new ArgumentNullException("bytes"); |
