On Thu, Jun 17, 2021 at 7:49 AM Tobias S. Josefowitz
<[email protected]> wrote:
>
> On Wed, Jun 16, 2021 at 11:08 PM Chris Angelico <[email protected]> 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).

Fair enough. The change is a very simple one. My recommendation is:
Use host_to_ips (in the plural) for most purposes.

I think this is ready for master branch now. Last call for comments or
objections.

> > 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.

Shouldn't be too hard. I'll just do the asynchronous version, but if a
threaded version is wanted, that might be of value too.

That'll be a separate project, but I'll see about creating
Stdio.establish_connection(name_or_ips) to do this.

ChrisA

Reply via email to