Ver a proveniência

Provide the full ACK on a connection failure

There are some systems that return information on a failed exception and thus the client wants access to the full set of ACK information.  Specifically the user properties.
release/3.x.x
Jim Schaad há 5 anos
ascendente
cometimento
9c378fb088
2 ficheiros alterados com 5 adições e 4 eliminações
  1. +4
    -3
      Source/MQTTnet/Adapter/MqttConnectingFailedException.cs
  2. +1
    -1
      Source/MQTTnet/Client/MqttClient.cs

+ 4
- 3
Source/MQTTnet/Adapter/MqttConnectingFailedException.cs Ver ficheiro

@@ -5,12 +5,13 @@ namespace MQTTnet.Adapter
{
public class MqttConnectingFailedException : MqttCommunicationException
{
public MqttConnectingFailedException(MqttClientConnectResultCode resultCode)
public MqttConnectingFailedException(MqttClientAuthenticateResult resultCode)
: base($"Connecting with MQTT server failed ({resultCode.ToString()}).")
{
ResultCode = resultCode;
Result = resultCode;
}

public MqttClientConnectResultCode ResultCode { get; }
public MqttClientAuthenticateResult Result { get; }
public MqttClientConnectResultCode ResultCode => Result.ResultCode;
}
}

+ 1
- 1
Source/MQTTnet/Client/MqttClient.cs Ver ficheiro

@@ -255,7 +255,7 @@ namespace MQTTnet.Client

if (result.ResultCode != MqttClientConnectResultCode.Success)
{
throw new MqttConnectingFailedException(result.ResultCode);
throw new MqttConnectingFailedException(result);
}

_logger.Verbose("Authenticated MQTT connection with server established.");


Carregando…
Cancelar
Guardar