how can i reconnect it?
When the connection is lost, the function onConnectionLost will be called, but how do I reconnect?
You can call connect within the connection lost callback
when reconnect is it still use old tcp port? and then three-way handshake to establish a connection?
i find in chrome will use same tcp port,but in firfox will use different tcp port. is right?
There are two ways of reconnecting: explicitly in the connection lost callback, and also using automatic reconnect (in the connect options). You should use one or the other, not both.
There should be no difference in the behaviour between Firefox and Chrome, as far as I'm aware.
ok,thank u very much
@icraggs I've tried the reconnect property, but it doesn't always seem to reconnect. For example most of the times on network change or network break it doesn't automatically reconnect.
I either have to manually reload the page or turn the wifi off and on again in my laptop for it to work.
Any idea why that might be happening? And is there any other way that might work?
@mridah I've seen the same issue on my end. Did you find a way to figure a way out?
@mridah when the ping timeout,it will trigger to reconnect network change or network break can not notify mqtt.JS