mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Refactoring.
This commit is contained in:
@@ -257,12 +257,12 @@ namespace MQTTnet.Client
|
||||
{
|
||||
var clientWasConnected = IsConnected;
|
||||
|
||||
InitiateDisconnect();
|
||||
|
||||
IsConnected = false;
|
||||
TryInitiateDisconnect();
|
||||
|
||||
try
|
||||
{
|
||||
IsConnected = false;
|
||||
|
||||
if (_adapter != null)
|
||||
{
|
||||
_logger.Verbose("Disconnecting [Timeout={0}]", Options.CommunicationTimeout);
|
||||
@@ -295,7 +295,7 @@ namespace MQTTnet.Client
|
||||
}
|
||||
}
|
||||
|
||||
private void InitiateDisconnect()
|
||||
private void TryInitiateDisconnect()
|
||||
{
|
||||
lock (_disconnectLock)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user