浏览代码

fixed async await return bug

release/3.x.x
Eggers Jan 7 年前
父节点
当前提交
455a047242
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      MQTTnet.Core/Client/MqttClient.cs

+ 3
- 0
MQTTnet.Core/Client/MqttClient.cs 查看文件

@@ -288,12 +288,14 @@ namespace MQTTnet.Core.Client
if (publishPacket.QualityOfServiceLevel == MqttQualityOfServiceLevel.AtMostOnce)
{
FireApplicationMessageReceivedEvent(publishPacket);
return;
}

if (publishPacket.QualityOfServiceLevel == MqttQualityOfServiceLevel.AtLeastOnce)
{
FireApplicationMessageReceivedEvent(publishPacket);
await SendAsync(new MqttPubAckPacket { PacketIdentifier = publishPacket.PacketIdentifier });
return;
}

if (publishPacket.QualityOfServiceLevel == MqttQualityOfServiceLevel.ExactlyOnce)
@@ -306,6 +308,7 @@ namespace MQTTnet.Core.Client

FireApplicationMessageReceivedEvent(publishPacket);
await SendAsync(new MqttPubRecPacket { PacketIdentifier = publishPacket.PacketIdentifier });
return;
}

throw new MqttCommunicationException("Received a not supported QoS level.");


正在加载...
取消
保存