hivemq/hivemq-mqtt-client

How to force cancel/interrupt a reconnecting state client?

bigcat26 opened this issue ยท 3 comments

Checklist

โ“ Question

How to force cancel/interrupt a reconnecting state client?

๐Ÿ“Ž Additional context

When I try to disconnect a Mqtt3RxClient that is in the DISCONNECTED_RECONNECT state, it returns a throwable with the message โ€˜com.hivemq.client.mqtt.exceptions.MqttClientStateException: MQTT client is not connected.โ€™ However, it may still successfully reconnect after a while, which is not what I want. I need to force an interruption of the reconnecting process immediately, such as by closing the underlying socket, but I did not find any API to access the underlying socket. Do you have any suggestions?