-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix websocket disconnection handling
Qt MQTT already emits the appropriate disconnected signal and closes the websocket when it detects that the websocket has disconnected, so the previous manual handler caused the signals to be emitted twice. However, in non-websocket case, we also need to handle the case where the initial connection fails (and manually trigger our onDisconnected() handler, to perform reconnect etc). We detect this by handling error change and state change from the MQTT client. Finally, fix the reconnect count (as it was previously reset in a queued connection).
- Loading branch information
Showing
2 changed files
with
54 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters