mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
Update MqttClient.cs
This commit is contained in:
@@ -188,6 +188,8 @@ namespace MQTTnet.Server
|
||||
// own exception in the reading loop!
|
||||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
await Task.Yield();
|
||||
|
||||
var packet = await ChannelAdapter.ReceivePacketAsync(cancellationToken).ConfigureAwait(false);
|
||||
if (packet == null)
|
||||
{
|
||||
@@ -315,6 +317,10 @@ namespace MQTTnet.Server
|
||||
{
|
||||
packetBusItem.MarkAsFailed(exception);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await Task.Yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
|
||||
Reference in New Issue
Block a user