From 455a047242538d92e1105f72ed237c54ede5d6af Mon Sep 17 00:00:00 2001 From: Eggers Jan Date: Wed, 13 Sep 2017 09:35:56 +0200 Subject: [PATCH] fixed async await return bug --- MQTTnet.Core/Client/MqttClient.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MQTTnet.Core/Client/MqttClient.cs b/MQTTnet.Core/Client/MqttClient.cs index 62c6bb3..62a5476 100644 --- a/MQTTnet.Core/Client/MqttClient.cs +++ b/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.");