Parcourir la source

fixed the other timing issue

release/3.x.x
Jan Eggers il y a 7 ans
Parent
révision
acbf9153f4
2 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. +4
    -2
      MQTTnet.Core/Server/MqttClientSession.cs
  2. +2
    -0
      Tests/MQTTnet.Core.Tests/MqttServerTests.cs

+ 4
- 2
MQTTnet.Core/Server/MqttClientSession.cs Voir le fichier

@@ -94,9 +94,11 @@ namespace MQTTnet.Core.Server
}
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);
}
}
}


+ 2
- 0
Tests/MQTTnet.Core.Tests/MqttServerTests.cs Voir le fichier

@@ -76,6 +76,8 @@ namespace MQTTnet.Core.Tests
await c2.DisconnectAsync();

await Task.Delay(1000);

await c1.DisconnectAsync();
}
finally
{


Chargement…
Annuler
Enregistrer