-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
[question] how keepaliveLimit works #1020
Comments
Hi, the keepalive timeout is always set and managed by the client. |
Thank you for the explanation! After reviewing the MQTT.js client source code (github.com/mqttjs/MQTT.js), I now understand your points better. I do have another question: If keepaliveLimit is set to 0, does that restrict PINGREQ messages from being received or PINGRESP messages from being sent? If not, why would a keepalive timeout occur on the client side? For context, our client is using a keepalive of 20 seconds to connect to the broker. |
If the keepalive is 20sec, your client should send the ping at least each 20sec. The broker has an inner 1.5x tolerance, so if the ping doesn't arrive in 30sec, the keep alive timeout error is thrown. |
I will give it a try. Thank you very much for your suggestions. |
Based on the documentation stating that
keepaliveLimit 0
means "no limit," does this imply that a client session will remain active even if no PINGREQ is sent by the client? However, I still encounterclientError
with a keepalive timeout message, and the client session disconnects randomly. Why is this happening?The text was updated successfully, but these errors were encountered: