ipv6 support for get_socket()