mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Refactor web socket usage
This commit is contained in:
@@ -56,7 +56,7 @@ namespace MQTTnet.Core.Server
|
||||
{
|
||||
if (_pendingPublishPackets.Count == 0)
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(5)).ConfigureAwait(false);
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(5), cancellationToken).ConfigureAwait(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace MQTTnet.Core.Server
|
||||
foreach (var publishPacket in packets)
|
||||
{
|
||||
publishPacket.Dup = true;
|
||||
_pendingPublishPackets.Add(publishPacket);
|
||||
_pendingPublishPackets.Add(publishPacket, cancellationToken);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
@@ -80,7 +80,7 @@ namespace MQTTnet.Core.Server
|
||||
foreach (var publishPacket in packets)
|
||||
{
|
||||
publishPacket.Dup = true;
|
||||
_pendingPublishPackets.Add(publishPacket);
|
||||
_pendingPublishPackets.Add(publishPacket, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user