Please find all the available states of the Handler in the list below.
The Handler is disconnected.
The intermediate state when the Handler is not disconnected but not connected.
Handler is connected.
The intermediate state when the Handler is not connected but not disconnected.
To track the Handler's state you need to implement HandlerStateListener class interface and register an instance with the Handler using Handler::registerHandlerStateListener member.
Let's take a closer look what triggers transitions between the Handler's states.
If the Handler is in the Disconnected state and user code calls Handler::connect, user code will receive a callback with new state set to HandlerState::Connecting.
If the Handler is in any other state except Disconnected and user code calls Handler::connect, the Handler will first disconnects and only after successful disconnect user code will receive a callback with new state set to HandlerState::Connecting.
If the Handler is in the Disconnected state and user code calls Handler::disconnect, user code will not receive any callback.
If the Handler is in any other state except Disconnected and user code calls Handler::disconnect, user code will receive a callback with new state set to HandlerState::Disconnecting.