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

Reconnection to MQTT server fails #17

Open
chotee opened this issue Oct 20, 2018 · 0 comments
Open

Reconnection to MQTT server fails #17

chotee opened this issue Oct 20, 2018 · 0 comments

Comments

@chotee
Copy link
Member

chotee commented Oct 20, 2018

When the MQTT server is rebooted, the MQTT client does not reconnect to the server once that becomes available again. The consequence being that mqtt publishing services are still not working long after the server has come back.

https://godoc.org/github.com/yosssi/gmq/mqtt/client#ConnectOptions has setting PINGRESPTimeout . This can be set to time.Duration that it is allowed for the ping to make it back. If that fails
https://godoc.org/github.com/yosssi/gmq/mqtt/client#pkg-variables documents the errors ErrPINGRESPTimeout or ErrInvalidPINGRESP . as the errror to be raised if the server is no longer available.

I don't know if PINGRESPTimeout also triggers that PINGREQs are send by the client or what sets the frequency that that happens. I suspect you have the send your own PINGREQs ( https://godoc.org/github.com/yosssi/gmq/mqtt/packet#PINGREQ ) to trigger the timeout to happen.

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

1 participant