eclipse / paho.mqtt.m2mqtt

Eclipse Public License 1.0
512 stars 303 forks source link

Changed returntype of the Connect() function from byte to the complete Connack Message - Only way to determine the existence of the persistent session #137

Open Daniel900 opened 1 year ago

Daniel900 commented 1 year ago

The Code of the Client and MqttMsgConnack class already got changed to support the sessionPresent flag of mqtt v3.1.1. But there is no way to get this flag, because the connect function just returns the return code and not the complete connack message. This flag is very useful when working with persistent sessions to determine if a session already exists or every topic should be subscribed. (double subscription also works but if you have any retained messages (as I do) they'll get pulled twice)