> Does it really make sense to handle the whole connection establishment
> issue inside the app, instead of inside the API itself?
Those are the core APIs we have today. We could have better ones, but
IMHO I think we need to fix problems in the current ones as long as we
don't have a widely-deployed alternative.
> I think that if we're debating this, we're implicitly assuming that
> applications want to connect to say www.example.com, and not one specific
> IP address to which it maps to.
>
> So why not implement such a "higher-level" connect(), and handle all the
> relevant issues inside the API?
Defining such APIs is probably beyond the scope of the work we can do,
and the things we can fix except in the 5+ year timeframe.. but if I
get you right, you're proposing that instead of:
1) getaddrinfo() or gethostbyname() and connect for one address,
[where, arguably, TCP retry timeout could be warranted -- I don't
think so myself, but you could argue for it]
2) getaddrinfo() / gethostbyname() loop to connect to one address
[where TCP retry timeout could not be warranted]
You'd be proposing to create a new function to accomplish 2) in such a
manner that it would also react to ICMP messages, etc?
> Doesn't the problem really have to do with having applications performing
> such a low-level action?
At some point, someone has to decide which behaviour is desirable.
Isn't this only hiding the same policy decision inside an abstraction
layer
(I don't deny that better APIs would not hurt, but we still seem to
require low-level C-like primitives, and unless there are additional
ones implemented there, we still have to fix the problems somehow..)