From ae80de26ec046ca92fc7ea6151f2ed30793c18bb Mon Sep 17 00:00:00 2001 From: JanEggers Date: Thu, 5 Jul 2018 19:41:58 +0200 Subject: [PATCH] addressed feedback --- Source/MQTTnet/Server/MqttClientSession.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/MQTTnet/Server/MqttClientSession.cs b/Source/MQTTnet/Server/MqttClientSession.cs index 204bdea..8ef401c 100644 --- a/Source/MQTTnet/Server/MqttClientSession.cs +++ b/Source/MQTTnet/Server/MqttClientSession.cs @@ -29,7 +29,7 @@ namespace MQTTnet.Server private MqttApplicationMessage _willMessage; private bool _wasCleanDisconnect; private IMqttChannelAdapter _adapter; - private Task _run; + private Task _workerTask; private IDisposable _cleanupHandle; public MqttClientSession( @@ -69,8 +69,8 @@ namespace MQTTnet.Server public Task RunAsync(MqttConnectPacket connectPacket, IMqttChannelAdapter adapter) { - _run = RunInternalAsync(connectPacket, adapter); - return _run; + _workerTask = RunInternalAsync(connectPacket, adapter); + return _workerTask; } private async Task 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 {