From 1d455221e475a781429e51e8850eeab7f9d81c04 Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Tue, 5 Jun 2018 21:28:11 +0200 Subject: [PATCH] Clear awaiters after an exception has occured. --- Frameworks/MQTTnet.NetStandard/Client/MqttPacketDispatcher.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Frameworks/MQTTnet.NetStandard/Client/MqttPacketDispatcher.cs b/Frameworks/MQTTnet.NetStandard/Client/MqttPacketDispatcher.cs index dec106d..fd205c5 100644 --- a/Frameworks/MQTTnet.NetStandard/Client/MqttPacketDispatcher.cs +++ b/Frameworks/MQTTnet.NetStandard/Client/MqttPacketDispatcher.cs @@ -15,6 +15,8 @@ namespace MQTTnet.Client { Task.Run(() => awaiter.Value.TrySetException(exception)); // Task.Run fixes a dead lock. Without this the client only receives one message. } + + _awaiters.Clear(); } public void Dispatch(MqttBasePacket packet)