Description:
During MQTT client startup, if the server is disconnected, the client automatically attempts to reconnect. If the application calls disconnect() during this reconnection phase, it only receives a "client is connecting" notification. This makes it difficult to properly handle disconnection during reconnection states.
Problem:
Currently, there's no way to:
Determine if the client is in a reconnection attempt state
Get the current connection state when disconnecting during reconnection
Properly synchronize disconnect operations with reconnection logic
Suggested Solution:
Provide an API to:
Expose the current connection state (including reconnection status)
Allow checking whether reconnection attempts are in progress