Hacker News new | ask | show | jobs
by Dagger2 13 days ago
> connect(const char *hostname, uint16_t port)

It would be `connect(const char *hostname, const char* servname)`, since it's a bit silly to take hostnames yet force the user to resolve the service name themselves.

So many programming languages have made that mistake in their socket APIs...

1 comments

You will still need custom ports for unregistered services or for point-to-point communication. But yeah, definitely a good idea to have both versions!