提交 36b1ed06 编写于 作者: C Christian

Update MqttClient.cs

上级 4a982ea2
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册