Browse Source

Fix issues in ApplicationMessageInterceptor.

release/3.x.x
Christian Kratky 5 years ago
parent
commit
20a7579156
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      Source/MQTTnet/Server/MqttClientSessionsManager.cs

+ 5
- 2
Source/MQTTnet/Server/MqttClientSessionsManager.cs View File

@@ -186,7 +186,10 @@ namespace MQTTnet.Server
{
if (interceptorContext.CloseConnection)
{
await queuedApplicationMessage.Sender.StopAsync().ConfigureAwait(false);
if (sender != null)
{
await sender.StopAsync().ConfigureAwait(false);
}
}

if (interceptorContext.ApplicationMessage == null || !interceptorContext.AcceptPublish)
@@ -207,7 +210,7 @@ namespace MQTTnet.Server
foreach (var clientSession in _sessions.Values)
{
clientSession.EnqueueApplicationMessage(
queuedApplicationMessage.ApplicationMessage,
applicationMessage,
sender?.ClientId,
false);
}


Loading…
Cancel
Save