diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-03-29 02:25:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-29 02:25:37 -0400 |
| commit | 88e3fcfdc78fcab201fad72466bf2aa50b453210 (patch) | |
| tree | 1e40408a0167aa2dca47ac07b16afa26e94d18d1 /RSSDP/SsdpCommunicationsServer.cs | |
| parent | 75f58d5665322a5045649aed89aecfef011b315c (diff) | |
| parent | 9f9e81089f5606e958bc8c3f0e4d73475d02372a (diff) | |
Merge pull request #2554 from MediaBrowser/beta
Beta
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
| -rw-r--r-- | RSSDP/SsdpCommunicationsServer.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index 99e3969aa..cc464e689 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -177,12 +177,16 @@ namespace Rssdp.Infrastructure { try { - await socket.SendAsync(messageData, messageData.Length, destination, cancellationToken).ConfigureAwait(false); + await socket.SendWithLockAsync(messageData, messageData.Length, destination, cancellationToken).ConfigureAwait(false); } catch (ObjectDisposedException) { } + catch (OperationCanceledException) + { + + } catch (Exception ex) { _logger.ErrorException("Error sending socket message from {0} to {1}", ex, socket.LocalIPAddress.ToString(), destination.ToString()); @@ -341,11 +345,9 @@ namespace Rssdp.Infrastructure foreach (var socket in sockets) { - await socket.SendAsync(messageData, messageData.Length, destination, cancellationToken).ConfigureAwait(false); + await SendFromSocket(socket, messageData, destination, cancellationToken).ConfigureAwait(false); } } - - ThrowIfDisposed(); } private ISocket ListenForBroadcastsAsync() |
