eclipse-paho / paho.mqtt.java

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

Documentation error about Session Expiry Interval property. #1034

Open freyssin opened 6 months ago

freyssin commented 6 months ago

Please fill out the form below before submitting, thank you!

The Javadoc of the methods getSessionExpiryInterval (L498-506) and setSessionExpiryInterval (L508-529) in MqttConnectionOptions class are false and seriously mislead the user. This javadoc states that "By default this value is null and so will not be sent, in this case, the session will not expire.". The first part of the sentence is true, the second is false. Indeed, in the section 3.1.2.11.2 the MQTT v5 specification says: "If the Session Expiry Interval is absent the value 0 is used. If it is set to 0, or is absent, the Session ends when the Network Connection is closed."

The error is also present in comment line 102.