Ok, true. So you'd want open_socket() to take extra parameters for the target machine's address and resolve that internally?
Well, the extra parameter is already there. But I'd rather see the target machine's address passed by user code than an integer computed by dubious means. open_socket() can then use get_inet_addr() to convert the string into an address family in exactly the same way that connect() would have done.
How did the people implementing v6 support in Pike 7.7 intend it to work?
My intention was that you should never have to worry about what protocol family an address uses. The protocol family numers are intentionally not exposed because a need to use them indicates a failure to achieve that goal, and a need to redesign some part of the API (in this case open_socket()).