Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle all possible MQTT disconnect exceptions #47

Merged

Conversation

FredericMa
Copy link
Contributor

This PR improves the handling of MQTT disconnects.
Previously, only Mqtt3DisconnectException and Mqtt5DisconnectException were handled.

  • ConnectionFailedException if a connect attempt failed.
  • Mqtt3ConnAckException or Mqtt5ConnAckException (depending on the MQTT version of the client) if the ConnAck message contained an error code, which means that the connect was rejected.
  • ConnectionClosedException if the connection was closed without sending a Disconnect message (use getSource() to determine if the server or the client closed the connection).
  • Mqtt3DisconnectException or Mqtt5DisconnectException (depending on the MQTT version of the client) if the connection was closed with a Disconnect message (use getSource() to determine if the server, the user or the client sent the Disconnect message).

This PR probably fixes #39 and #40.

@netlify
Copy link

netlify bot commented Nov 1, 2022

Deploy Preview for wallpanel canceled.

Name Link
🔨 Latest commit bebf032
🔍 Latest deploy log https://app.netlify.com/sites/wallpanel/deploys/63618d7c54e4070008363cdb

@TheTimeWalker
Copy link
Owner

Trusting your changes. Thank you for looking into this bug!

@TheTimeWalker TheTimeWalker merged commit 2dbe945 into TheTimeWalker:master Nov 1, 2022
@FredericMa FredericMa deleted the handle-all-disconnects branch November 1, 2022 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Lost connection to wall panel
2 participants