浏览代码

addressed feedback

release/3.x.x
JanEggers 6 年前
父节点
当前提交
ae80de26ec
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. +5
    -5
      Source/MQTTnet/Server/MqttClientSession.cs

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

@@ -29,7 +29,7 @@ namespace MQTTnet.Server
private MqttApplicationMessage _willMessage;
private bool _wasCleanDisconnect;
private IMqttChannelAdapter _adapter;
private Task<bool> _run;
private Task<bool> _workerTask;
private IDisposable _cleanupHandle;

public MqttClientSession(
@@ -69,8 +69,8 @@ namespace MQTTnet.Server

public Task<bool> RunAsync(MqttConnectPacket connectPacket, IMqttChannelAdapter adapter)
{
_run = RunInternalAsync(connectPacket, adapter);
return _run;
_workerTask = RunInternalAsync(connectPacket, adapter);
return _workerTask;
}

private async Task<bool> RunInternalAsync(MqttConnectPacket connectPacket, IMqttChannelAdapter adapter)
@@ -134,7 +134,7 @@ namespace MQTTnet.Server
{
_adapter.ReadingPacketStarted -= OnAdapterReadingPacketStarted;
_adapter.ReadingPacketCompleted -= OnAdapterReadingPacketCompleted;
await Cleanup();
await Cleanup().ConfigureAwait(false);
}

_adapter = null;
@@ -183,7 +183,7 @@ namespace MQTTnet.Server

_willMessage = null;

_run?.GetAwaiter().GetResult();
_workerTask?.GetAwaiter().GetResult();
}
finally
{


正在加载...
取消
保存