Enh : Added support for IPv6

Use getaddrinfo() to get family.