ConnectionFailed

class ConnectionFailed(reasonCode: ReasonCode, message: String, cause: Throwable? = null) : MqttException

The connection attempt failed before the broker accepted or refused it.

Covers transport-level failures during MqttClient.connect — DNS resolution, TCP connect, TLS handshake, a socket that closed mid-handshake, and a CONNACK that never arrived. The broker never expressed an opinion, so the attempt is worth retrying; contrast ConnectionRejected, which carries the broker's own refusal and will fail the same way against the same configuration.

Constructors

Link copied to clipboard
constructor(reasonCode: ReasonCode, message: String, cause: Throwable? = null)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard

The MQTT 5.0 reason code associated with this error.