diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-28 01:41:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-28 01:41:46 -0500 |
| commit | 2192fce50e668768ed48c3882ccdb10fab9d6def (patch) | |
| tree | 21ea84bbfd86a86323cb5d022a6e79e1a359c09e /Emby.Server.Implementations/Udp/UdpServer.cs | |
| parent | 422b80678dfa291795458a121eb9ec83e42e0d0b (diff) | |
| parent | 0fd7e89039265ffa6dccaa2a029377e74d0c6057 (diff) | |
Merge pull request #2368 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Udp/UdpServer.cs')
| -rw-r--r-- | Emby.Server.Implementations/Udp/UdpServer.cs | 13 |
1 files changed, 13 insertions, 0 deletions
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"); |
