Browse Source

Refactoring.

release/3.x.x
Christian Kratky 5 years ago
parent
commit
8bfbbd2b29
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      Source/MQTTnet/Client/MqttClient.cs

+ 4
- 4
Source/MQTTnet/Client/MqttClient.cs View File

@@ -257,12 +257,12 @@ namespace MQTTnet.Client
{ {
var clientWasConnected = IsConnected; var clientWasConnected = IsConnected;


InitiateDisconnect();

IsConnected = false;
TryInitiateDisconnect();


try try
{ {
IsConnected = false;

if (_adapter != null) if (_adapter != null)
{ {
_logger.Verbose("Disconnecting [Timeout={0}]", Options.CommunicationTimeout); _logger.Verbose("Disconnecting [Timeout={0}]", Options.CommunicationTimeout);
@@ -295,7 +295,7 @@ namespace MQTTnet.Client
} }
} }


private void InitiateDisconnect()
private void TryInitiateDisconnect()
{ {
lock (_disconnectLock) lock (_disconnectLock)
{ {


Loading…
Cancel
Save