Comment 28 for bug 309402

Jacek Sieka (arnetheduck) wrote :

Well, for one when resolving with getaddrinfo, you might get more than one ip (in truth there might be more than 2 but I cheat a little), and you're supposed to connect to all, either in parallel or in the returned addrinfo order - so for example if a domain advertises both an ipv4 and an ipv6 address but the hub/server only runs on one, you're in for a long wait if you connect sequentially (and no connection at all if you keep using just the first resolved address). The second problem is that while you might have an ipv6 address, seeing that everything is quite fresh it might not work for config reasons so it stands to reason to try ipv4 as well if available.

As to the protocol, I agree that is an issue - there are more issues such as references to a long deprecated rfc for the ipv6 address format (I haven't checked but I hope it is in line with the latest representations (rfc 5952 and 4291). In any case, until the issue is resolved, one might as well try both and see which one works (from what I can tell, most servers listen to the same port on both v4 and v6, specially the hybrid dual-stack ones - so the question is whether it makes sense to have separate u4 and u6 ports...