You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConnectAsync returns an MqttClientConnectResult which holds an MqttClientConnectResultCode. MqttClientConnectResultCode can indicate all kinds of errors while establishing a connection. But different than expected an exception is thrown.
Which component is your bug related to?
Client
To Reproduce
Steps to reproduce the behavior:
Using Version 4.1.4.563 of MQTTnet
Run this server code
var factory = new MqttFactory();
var serverOptions = factory.CreateServerOptionsBuilder().WithDefaultEndpoint();
_mqttServer = factory.CreateMqttServer(serverOptions.Build());
_mqttServer.ValidatingConnectionAsync += (e) => {
e.ReasonCode = MQTTnet.Protocol.MqttConnectReasonCode.BadUserNameOrPassword;
return Task.CompletedTask;
};
_mqttServer.StartAsync().GetAwaiter().GetResult();
Describe the bug
ConnectAsync returns an MqttClientConnectResult which holds an MqttClientConnectResultCode. MqttClientConnectResultCode can indicate all kinds of errors while establishing a connection. But different than expected an exception is thrown.
Which component is your bug related to?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
ConnectAsync should return a MqttClientConnectResult that has the ResultCode set to a value indicating non success.
The text was updated successfully, but these errors were encountered: