fixed the other timing issue

This commit is contained in:
Jan Eggers
2017-11-09 11:06:50 +01:00
parent b6cd4638b9
commit acbf9153f4
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -94,9 +94,11 @@ namespace MQTTnet.Core.Server
} }
finally finally
{ {
if (_willMessage != null) var willMessage = _willMessage;
if (willMessage != null)
{ {
_sessionsManager.DispatchApplicationMessage(this, _willMessage); _willMessage = null; //clear willmessage so it is send just once
_sessionsManager.DispatchApplicationMessage(this, willMessage);
} }
} }
} }
@@ -76,6 +76,8 @@ namespace MQTTnet.Core.Tests
await c2.DisconnectAsync(); await c2.DisconnectAsync();
await Task.Delay(1000); await Task.Delay(1000);
await c1.DisconnectAsync();
} }
finally finally
{ {