From d14088512bdafd8b51d3c290f91f7fc2b67fe66f Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 3 May 2018 20:47:15 +0200 Subject: [PATCH] Refactoring --- Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs b/Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs index 11d7111..2e04c90 100644 --- a/Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs +++ b/Frameworks/MQTTnet.NetStandard/Client/MqttClient.cs @@ -50,8 +50,8 @@ namespace MQTTnet.Client try { - _options = options; _cancellationTokenSource = new CancellationTokenSource(); + _options = options; _packetIdentifierProvider.Reset(); _packetDispatcher.Reset(); @@ -212,7 +212,7 @@ namespace MQTTnet.Client WillMessage = willApplicationMessage }; - var response = await SendAndReceiveAsync(connectPacket, _cancellationTokenSource.Token).ConfigureAwait(false); + var response = await SendAndReceiveAsync(connectPacket, cancellationToken).ConfigureAwait(false); if (response.ConnectReturnCode != MqttConnectReturnCode.ConnectionAccepted) { throw new MqttConnectingFailedException(response.ConnectReturnCode);