diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-03-26 15:00:35 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-03-26 15:00:35 -0400 |
| commit | caaa906604c759e6899ebf6be6f5ac4f9845db84 (patch) | |
| tree | 6b7be01aed32a0c861f125ff361a1e36a61d0bed /RSSDP | |
| parent | 240000f965f5cb7df1c8c46245c5a93a9007c8f8 (diff) | |
update socket methods
Diffstat (limited to 'RSSDP')
| -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() |
