+ char S[30] = "http";
+ if (Port != 0)
+ snprintf(S,sizeof(S),"%u",Port);
+
+ // Free the old address structure
+ if (LastHostAddr != 0)
+ {
+ freeaddrinfo(LastHostAddr);
+ LastHostAddr = 0;
+ }
+
+ // We only understand SOCK_STREAM sockets.
+ struct addrinfo Hints;
+ memset(&Hints,0,sizeof(Hints));
+ Hints.ai_socktype = SOCK_STREAM;
+
+ // Resolve both the host and service simultaneously
+ if (getaddrinfo(Host.c_str(),S,&Hints,&LastHostAddr) != 0 ||
+ LastHostAddr == 0)