Skip to content

Provide connection state API during reconnection attempts when disconnecting #1079

@tartea

Description

@tartea

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions