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

Add on_closed callback to MQTT311 #258

Merged
merged 4 commits into from
Feb 3, 2023
Merged

Conversation

TwistedTwigleg
Copy link
Contributor

Description of changes:

Adds a on_closed callback that is called whenever a MQTT311 connection is fully closed. This is similar to the on_disconnect callback, but unlike that callback, this callback can be set once and will be called for every single successful, user-initiated disconnect, unlike the on_disconnect callback that is set each time you call disconnect.

This is for exposing this callback to the CRTs, which will allow the on_closed callback to be bubbled up akin to the V1 SDK API (reference).

Also adds tests to ensure the functionality works as expected and only is invoked on successful disconnects and not interrupts.

Note: If #254 is merged first, then this PR will need modification to call the on_closed callback when the disconnect is invoked via the reconnect, and vice versa should this PR be merged first.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

include/aws/mqtt/client.h Outdated Show resolved Hide resolved
@TwistedTwigleg
Copy link
Contributor Author

Thanks! Merging into main...

@TwistedTwigleg TwistedTwigleg merged commit 13cae5a into main Feb 3, 2023
@TwistedTwigleg TwistedTwigleg deleted the extra_connection_callbacks branch February 3, 2023 20:48
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.

None yet

2 participants