eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 884 forks source link

Server Keep Alive 1/2 of ConnectionOptions.keepAliveInterval causes ClientState to generate WIRTE_TIMEOUT Exception #895

Open jkamke opened 3 years ago

jkamke commented 3 years ago

If Server Keep Alive is set to 1/2 +1 (or more) ClientState.checkForActivity will issue a pingreq and adapts to the change. However, a Server Keep Alive of 1/2 or less of ConnectionOptions.keepAliveInterval will always result in ClientState.checkForActivity throwing, because the timer is set before the client considers the ConnectAck:ServerKeepAlive, but the check is done considering the new value (which indicates tardiness).

According to the spec the client is expected to: