浏览代码

Fix issues in ApplicationMessageInterceptor.

release/3.x.x
Christian Kratky 5 年前
父节点
当前提交
20a7579156
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. +5
    -2
      Source/MQTTnet/Server/MqttClientSessionsManager.cs

+ 5
- 2
Source/MQTTnet/Server/MqttClientSessionsManager.cs 查看文件

@@ -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);
}


正在加载...
取消
保存