Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Incorrect reason code on ping timeout

Roger, I suspect this is one for you... if the mosquitto client library fails to receive a PINGRESP within the expected keep-alive period, it ends up in the function mosquitto_loop_misc() in lib/mosquitto.c around line 1096 onwards. In this case, it simply sets the 'rc' value to 1,and then passes it into the on_disconnect() callback.

I have seen this error in the wild, and have been interpreting the reason as MOSQ_ERR_NOMEM (which is error 1). The code just has a literal "rc = 1" rather than using one of the error constants, as I would have expected. Surely MOSQ_ERR_CONNLOST would be more appropriate (or even a new code indicating the specific error)?

If you agree, I'd be happy to provide a patch or raise an issue or PR?

thanks
  Dave.


Back to the top