To explain further, my LS client software will contain various details about the LS server it needs to connect to.

One of the things it will be given is the hostname - but this will be a comma delimited list of hostnames for the connection to try, in sequence, until successful.

How do I achieve this efficiently? I want to try the first hostname, and as quickly as possible know if this is valid (connected) before moving on to try the next one if it is no good.

Normally, the LS client will gone into a "retry" loop if it fails to connect. Obviously I don't want that to happen while it is locating the correct hostname. I want it to try and if its is no good - fail and move on.

Once it finds a good one, I can then disconnect and reconnect with the normal parameters.

What options to I need to set to achieve this?