MqttClient

constructor(config: MqttConfig, scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default))

Parameters

config

Client configuration mapping to CONNECT packet fields (§3.1).

scope

Coroutine scope for background jobs. Defaults to a new SupervisorJob on Dispatchers.Default. The client creates a child scope, so cancelling the provided scope also cancels all client operations.