On Wed, Jun 16, 2021 at 11:08 PM Chris Angelico rosuav@gmail.com wrote:
Should host_to_ip be put completely back how it was (IPv4 only), or should it return IPv4 if available, IPv6 else?
In my opinion returning IPv6 if no IPv4 can be found would neither be something that even new users (i.e. people calling the method after that behaviour would have been introduced) would expect, or for that matter, desire. I suppose the proposed utility in behaving like this is in the case where some code blindly passing on the result to e.g. connect() or similar would magically and/or accidentally simply keep working with IPv6-only hostnames. I would think that that is not worth the confusion, surprise and wholly unexpected system states (in user programs never expecting this to happen).
Happy Eyeballs, if implemented, should probably be an option - it's a tradeoff between faster connections and more load. Might be worth actually pushing that one down in the stack a bit, maybe a Stdio or Protocols function that establishes a connection and returns it?
I would really like that.