3 ms·
Absolutely not. You can have sockets without DNS. You can pick whatever strategy you want when there are multiple A records. You can use SRV records instead. A
by drdexebtjl 3mo ago
Absolutely not.
You can have sockets without DNS. You can pick whatever strategy you want when there are multiple A records. You can use SRV records instead. And most importantly imo, it mirrors the listening API.
- cyberax 3mo agoRaw addresses could have been an advanced option, rather than a requirement for every program.
- UltraSane 3mo agoExactly
- GoblinSlayer 3mo agoUnix sockets kinda already connect by name.
- inigyou 3mo agoUse getaddrinfo
- drdexebtjl 3mo agoI feel like this wouldn’t be a problem if we had decent APIs for name resolution (separate from sockets) instead. The ones we have suck or are non-standard.
- cyberax 3mo agoNope. They have to be coupled for the Happy Eyeballs to work. Another option is for sockets to accept multiple addresses and address families in "connect" calls, so that only one connection wins.
- drdexebtjl 3mo agoNo, they don’t. They aren’t coupled today, and applications implementing Happy Eyeballs work perfectly fine on top of sockets and a DNS client.
- cyberax 3mo agoWell, yeah. And I also can do IPv6 without any of these new-fangled application-level TCP by using raw sockets. War story: many years ago I was developing a service that runs computational tasks inside containers. That was when K8s didn't work well with cloud providers. The service was written in Go and worked on AWS. Everything worked fine for me and for our production deployment. Then people started using it with a Python client that used the REST API directly, and for some reason some people couldn't reach it when they were working from home. Reason: I misconfigured IPv6 on AWS by not enabling the default route, so all IPv6 connections were failing. Go has HappyEyeballs enabled by default, so it worked just fine. But Python did not have it back then. So people with IPv4-only connectivity (including our office) had no problems. But people with IPv6 were getting connection failures.