update socket methods

This commit is contained in:
Luke Pulverenti
2017-03-26 15:00:35 -04:00
parent 240000f965
commit caaa906604
5 changed files with 107 additions and 197 deletions

View File

@@ -177,11 +177,15 @@ 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)
{
@@ -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()