Previous implementation was not making sure the socket had the same family as the addr returned by getaddrinfo. So instead of "connection refused", we could get "invalid argument", which was our fault.