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

When is the disconnect callback called? #17

Closed
shekharhimanshu opened this issue Jun 15, 2017 · 5 comments
Closed

When is the disconnect callback called? #17

shekharhimanshu opened this issue Jun 15, 2017 · 5 comments

Comments

@shekharhimanshu
Copy link
Contributor

Hello,

Thank you for adding the disconnect callback in v1.1.0. Could you please explain when will applications receive this callback?

@vareddy-zz
Copy link
Contributor

Hi @shekharhimanshu,
The disconnect callback will be called when the keep-alive ping request fails, which means that the device has been disconnected, and just before it starts the auto-reconnect procedure.
The relevant code can be found here
I have provided more details in the other question that you posted (#18)
Please let us know if you have any more questions.
Thanks!
Varun

@shekharhimanshu
Copy link
Contributor Author

Hello @vareddy

Thank you for those details.
It looks like the disconnect callback will not be called if auto-enabled is false. See here. Is this by design?

When auto-reconnect is set to false, the client will disconnect after keep-alive period. Does that mean applications won't receive any notification about that disconnect event?

@vareddy-zz
Copy link
Contributor

Hi @shekharhimanshu,
The disconnect callback should be called even when the auto-reconnect is set to false. We seem to have missed this situation in our testing. I have made the fix in our internal repository and will be included in the next release.
Thanks a lot for your inputs! They are very useful for improving the SDK.
Varun

@shekharhimanshu
Copy link
Contributor Author

Looking forward to the next release.
Thanks.

@vareddy-zz
Copy link
Contributor

Hi @shekharhimanshu,
v1.1.1 of the SDK addresses this and ensures that the disconnect callback is called even when auto-reconnect is disabled. Please let us know if you see any more issues.
Thanks!
Varun

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

No branches or pull requests

2 participants