-
Notifications
You must be signed in to change notification settings - Fork 113
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
Missing disconnect callback? #4
Comments
Hi @shekharhimanshu, ClientState does cache the connection state but it is also updated in the Disconnect API which is called for cleanup whenever a disconnect or unrecoverable network state is detected. It should always have the correct information. That being said, I have been debating linking it to network layer changes as well. Do you notice any issues with the current implementation? Please let me know if you have further questions. Rahul |
Hello @chaurah, Thats great. Will wait for the next release for the disconnect callback. Yes, you are correct about the ClientState' connection state. Looks like I overlooked the part where the connection state was being updated. Thank you. Linking the cached connection state to network layer changes would improve the usability but I am not sure if I have considered other design issues/goals of the SDK. So would wait for any update about this as well. Unfortunately, I have just started designing my application using this SDK and all my feedbacks are based upon the documentation present and the source code. I will let you know if I find any issues during implementation/testing. |
Hi @shekharhimanshu, Rahul |
This issue has been resolved with v1.1 of the SDK Please reopen if you further questions. Rahul |
Hello, Could you please explain when will this disconnect callback be called? |
Also, I do not see any reopen issue button. Missing permission? |
I have opened a new issue instead. #17 |
Hello,
I am trying to understand how the SDK handles connection state. When auto-reconnect if set to false, SDK will not re-connect automatically after the
keep-alive
times out as set during connect and the mqtt client will become disconnected.In the current SDK design, applications will not be able to receive information about this
auto-disconnect
since the SDK does not provide with adisconnect callback
. aws-iot-device-sdk-embedded-C SDK provides us with such a callback here.Having a disconnect callback might be useful in cases when applications want to control the re-connection to AWS IoT or for some other book-keeping or resource cleanups etc.
I also saw that ClientState caches the connection state and the mqtt clients return it when IsConnected api is called. Having a disconnect callback can help in making this connection state consistent as well.
Am I missing something here?
The text was updated successfully, but these errors were encountered: