strongloop-community / loopback-example-pubsub

Example of using strong-pubsub with LoopBack
Other
23 stars 13 forks source link

Losing session on reconnect #7

Closed sw8fbar closed 9 years ago

sw8fbar commented 9 years ago

After I have started the server and subscribed to a topic from the client, If I close the server and start it again, The client reconnects but loses session, i.e. its not subscribed to the topic anymore, despite keeping the same client id and ip address - ports are different. How do I retain session on reconnect? I tried keeping "clean : false" but it didn't get messages sent after reconnect.

Also how do I get to know on the client side that I have lost the connection and will need to reconnect?

BTW, The way the project currently is has helped me immensely so thank you!

sw8fbar commented 9 years ago

I figured out that its the MQTT connection that is lost from the client side. Its only the websocket that is reconnecting. Is there a way to monitor the MQTT connection on the client side and know when connection has been lost?

sw8fbar commented 9 years ago

Never mind, I figured this out. Thanks anyway!