-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add function to disconnect from MQTT broker #272
Comments
Please elaborate why the existing MQTT client destruction logic is not good enough. |
In my application I publish some data and send the ESP32 to deep sleep mode right after that. If I want to do it right, I should disconnect from MQTT to make sure I can connect back after waking up. As far as I've seen in the code, there's only a call to |
Deep sleep means that your memory and the state of the CPU is completely gone. Once it awakes from deep sleep, it will essentially start over from the beginning of your |
Also: are you sure that the call to |
Correct me if I'm wrong, but even if I drop the MQTT client object, forcing a destruction, the server side might not be aware of this event (depending on the implementation, until a certain timeout). For instance, to avoid that issue, there's a method for WiFi disconnection exposed. |
Since you are looking at the C side of things, here's the chain of calls: Therefore, I'm wondering - are you experiencing an actual problem, or are you just looking at the C code and trying to figure out whether something would break if you don't do anything before going to deep sleep (or better yet - just Feel free to reopen with additional details in case you experience an actual issue. |
Rust implementation can't disconnect from a broker in a clean way.
The text was updated successfully, but these errors were encountered: