eclipse / paho.mqtt-sn.embedded-c

Paho C MQTT-SN gateway and libraries for embedded systems. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
314 stars 179 forks source link

Client reconnection to Gateway #218

Closed aplak1 closed 3 years ago

aplak1 commented 3 years ago

Hello, I developed a MQTT-SN client that search and connects to paho-mqtt-sn gateway. I usually register and scubscribe to all topics at each connection. According to MQTT-SN specifications I found out that the client should receive a REGISTER message from the gateway at reconnection (if the clean session flag is not set). My issue is that I do not see this REGISTER message coming from the gateway even when the clean session flag is not set.

Am I missing something or is this feature not implemented? Thanks!

ty4tw commented 3 years ago

Hi, GW had discarded a PUBLISH message that did not match with subscribed topics. However, I changed it to send REGISTER and PUBLISH message in case of the clean session.

In your case, Your client don’t need to handle REGISTER if it never sends a wild card topic.