diff options
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
| -rw-r--r-- | RSSDP/SsdpCommunicationsServer.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index e9dc4c54f..91004b76f 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -177,7 +177,7 @@ namespace Rssdp.Infrastructure { try { - await socket.SendWithLockAsync(messageData, messageData.Length, destination, cancellationToken).ConfigureAwait(false); + await socket.SendToAsync(messageData, 0, messageData.Length, destination, cancellationToken).ConfigureAwait(false); } catch (ObjectDisposedException) { @@ -392,11 +392,13 @@ namespace Rssdp.Infrastructure var t = Task.Run(async () => { var cancelled = false; + var receiveBuffer = new byte[8192]; + while (!cancelled) { try { - var result = await socket.ReceiveAsync(CancellationToken.None).ConfigureAwait(false); + var result = await socket.ReceiveAsync(receiveBuffer, 0, receiveBuffer.Length, CancellationToken.None).ConfigureAwait(false); if (result.ReceivedBytes > 0) { |
