# include "api/internal/io/NetUnix_p.h"
#endif
+#include <iostream> // debug
+
// standard C++ includes
#include <cstdlib>
#include <cstring>
// do 'normal' lookup
else {
+ cout << "HostInfo::Lookup() - looking up addresses for domain name: " << hostname << endl;
+
// setup address lookup 'hints'
addrinfo hints;
memset(&hints, 0, sizeof(hints));
// if everything OK
if ( status == 0 ) {
+ cout << "HostInfo::Lookup() - found addresses" << endl;
+
// iterate over all IP addresses found
addrinfo* p = res;
for ( ; p != NULL; p = p->ai_next ) {
if ( p->ai_family == AF_INET ) {
sockaddr_in* ipv4 = (sockaddr_in*)p->ai_addr;
HostAddress a( ntohl(ipv4->sin_addr.s_addr) );
+ cout << "\t" << a.GetIPString() << endl;
uniqueAddresses.insert(a);
}
else if ( p->ai_family == AF_INET6 ) {
sockaddr_in6* ipv6 = (sockaddr_in6*)p->ai_addr;
HostAddress a(ipv6->sin6_addr.s6_addr);
+ cout << "\t" << a.GetIPString() << endl;
uniqueAddresses.insert(a);
}
}
status == EAI_NONAME
|| status == EAI_FAIL
# ifdef EAI_NODATA
- || status == EAI_NODATA // officially deprecated, but just in case we run into it
+ || status == EAI_NODATA // officially deprecated, but just in case we happen to hit it
# endif // EAI_NODATA
#else // _WIN32