+- }
+- return(inaddr.sin_addr.s_addr);
+-
+-}
+-
++addr_list *resolve_hostname_to_ip(const char *host, const char *port, int pf)
++ {
++ /* TODO
++ * Do all supported platforms have "getaddrinfo"?
++ */
++
++ struct addrinfo hints, *res0;
++ int result;
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = pf;
++ hints.ai_socktype = SOCK_STREAM;
++
++ result = getaddrinfo(host, port, &hints, &res0);
++ if ( result != 0 )
++ {