eclipse / paho.mqtt.c

An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS. API documentation: https://eclipse.github.io/paho.mqtt.c/
https://eclipse.org/paho
Other
1.96k stars 1.09k forks source link

Improve handling of multiple IP addresses when returned by a DNS lookup. #410

Open jonquark opened 6 years ago

jonquark commented 6 years ago

At the moment during a connect, if a DNS lookup returns multiple IP addresses, only one of the addresses is selected and used.

If we cannot connect to that address, if the other addresses were attempted in turn as well then the client would be more fault tolerant of a server with multiple IP addresses.

One subtlety is the interaction of this feature with the HA feature. I propose that if two server names are provided, each of which resolves to multiple IP addresses then all the addresses of server1 would be attempted before attempting to connect to server2.

jonquark commented 6 years ago

There is an equivalent issue for the Java client here: https://github.com/eclipse/paho.mqtt.java/issues/475

xiangwangcheng commented 5 years ago

Any update on this issue?