eclipse-paho / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.16k stars 466 forks source link

Fix reconnecting if a list of hosts|uris was given. At the seconds+ failover #204

Open GreenRover opened 5 years ago

GreenRover commented 5 years ago

If you give >=2 hosts/uris i fixed following bug:

Initial state: host a: passive host b: active

Connected to host b succesfull ;-)

Failover 1: host a: active host b: passive

Reconnected to host a succesfull ;-)

Failover 2: host a: passive host b: active

Only try to connect to host a but never to host b )-; Reconnection attempt will faill forever. CHANGE: Now on reconnect it will loop through all hosts until it find one up and running.