mqttAndroidClient?.connect(mqttConnectOptions, null, object : IMqttActionListener {
override fun onSuccess(asyncActionToken: IMqttToken?) {
}
override fun onFailure(asyncActionToken: IMqttToken?, exception: Throwable?) {
}
})
Usage scenario:
1: Connect to a new mqtt connection and disconnect when not needed.
2: a new connection is generated in a few seconds.
causes success and failure callbacks not to be executed during connection.