Details
Description
RFC 2052 describes use for DNS SRV records. Each entry has 4 parts: A priority, a weight, a port, and the hostname. When multiple entries are returned:
"A client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in pseudorandom order."
Smack currently returns the first entry returned from the DNS server, which may not have the lowest-numbered priority, and then will not attempt any other servers since the other entries are discarded.
We now iterate through all of the DNS SRV records that get returned. "google.com" is a good case since there are 6 records. Technically, we should fall-back if the host in the first SRV record fails (and so on until we run out of SRV records). It won't be possible to do that without a pretty major rewrite of XMPPConnection, and that will have to come in a later version if requested (needed) by someone.