logoalt Hacker News

UltraSanetoday at 5:19 AM2 repliesview on HN

https://blog.ipspace.net/2009/08/what-went-wrong-socket-api/

A DNS name can have a LOT of A records associated but a socket has to pick one. This is a severe limitation.


Replies

drdexebtjltoday at 5:45 AM

A socket has to pick one, but your application doesn’t.

You can hedge your bets and open a connection and send data to _all_ of them, and pick whichever returns faster.

This of course requires you to know about the application-layer protocol.

For HTTP, you need to restrict this strategy to GET methods, for example.

Hence why it can’t be part of the socket interface.

You can always build higher level abstractions on top of sockets if you need them.

show 1 reply
jruohonentoday at 5:32 AM

> This is a severe limitation.

Rather, it is a feature.