Skip to content

Commit

Permalink
#1810 Close connection after failed connect. (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
jechtom authored Sep 1, 2023
1 parent 5965ded commit e0660ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/MQTTnet/Client/MqttClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public async Task<MqttClientConnectResult> ConnectAsync(MqttClientOptions option
if (connectResult.ResultCode != MqttClientConnectResultCode.Success)
{
_logger.Warning("Connecting failed: {0}", connectResult.ResultCode);
await DisconnectInternal(null, null, connectResult).ConfigureAwait(false);
return connectResult;
}

Expand Down

0 comments on commit e0660ba

Please sign in to comment.