-
Notifications
You must be signed in to change notification settings - Fork 720
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
How to cleanly disconnect without losing messages? #749
Comments
If I'm understanding you correctly then this is not something the MQTT protocol really supports (there is no way to ask the server to send all waiting messages and then disconnect). All you can really do is connect and wait until you believe you have all of the messages (possibly due to a timestamp within the message body, or timing out when, for example, no messages are received in a second).
If the above answers your question then please close off this issue, otherwise please provide further information re your requirements (but, perhaps, stackoverflow might be a better venue as this seems likely to be a protocol question rather than something specific to this library). |
The main doc page has this notation:
Is there any example of how to do the equivalent of this pseudocode?
Essentially I just want to "process anything pending in receive queue and then exit".
I have tried max_inflight_messages_set(), but that doesn't appear to change any behavior for received messages.
The text was updated successfully, but these errors were encountered: