Changed to use struct addrinfo where needed.