-
Notifications
You must be signed in to change notification settings - Fork 168
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
not sending keep alive ping packets? #164
Comments
On further investigate, I found that the library sometimes is late to to sending Setting |
Hi @brianmay though, it checks the number of bytes sent, instead of the actual number of packets sent. |
Yes, my suspicion was in that code also. Which I don't entirely understand. Here is an example log excerpt from mosquitto:
You can see here that the PINGs were working perfectly. Until we received the PUBLISH packets. Then mosquitto disconnected us after not receiving anything for 50 seconds. I believe I read somewhere that because we negotiated a keep alive period of 30 seconds, the server can kill the connection after 30*1.5 = 45 seconds. But in practise it can be longer then that. I imagine what happened is we decided to skip the 12:27:32 ping packet. Because we received traffic at 12:27:02. But this means the next ping would not have been sent until 12:28:02 which is too late. Instead of skipping scheduled packets, we should be adjusting the timer we send the next keepalive to +30 seconds from when we sent/received a packet. |
From all my clients using this library, and only clients using this library, I regularly get these messages from my mosquito mqtt broker:
I have tried different values for the
keepalive
parameter, and it hasn't helped. I tried 60, currently it is set to 30.I can only think that this library is not reliably sending the
PINGREQ
packets as required.The text was updated successfully, but these errors were encountered: