Java outgoing TCP connection failover based on multiple DNS results
If I make a connection using new Socket("unit.domain.com", 100) and the unit.domain.com DNS record has multiple IP addresses in the A record.. In the event of a failed connection, Does Java automatically connect to one of the other addresses in the list like the browser does? or does that have to be implemented manually? bestsss No! Creating a socket via new Socket(String, int) results in a resolving like that addr = InetAddress.getByName(hostname); which is a shortcut for return InetAddress.getAllByName(host)[0]; The address resolution is performed in the Socket c-tor. If you have to