5 ms·
The mere existence of getaddrinfo is a symptom of the disease. Just look at it. It lacks a clear interface. It's designed for calling code which is like, "Gee,
by blahdeeblah 11y ago
The mere existence of getaddrinfo is a symptom of the disease. Just look at it. It lacks a clear interface. It's designed for calling code which is like, "Gee, I don't know exactly what I've got. Maybe it's a local IPv6 address, maybe it's a remote hostname. But I might want to bind it. Or maybe connect to it. I'll get back a list of these things which might be useful. Most likely I'll choose the first one or maybe write an ad-hoc filter to pick the one I actually want." Systems programming doesn't have to be this crappy.
I get it, the idea is to replace this core low-level library with something you could maybe run C programs on top of. But damn, that is a crappy interface (which is specified by both an ISO standard and an IETF RFC so I must be an idiot, right?).