- WATCHPOINT_STRING(server->hostname);
- WATCHPOINT_STRING(gai_strerror(e));
- return MEMCACHED_HOST_LOOKUP_FAILURE;
+ int e= getaddrinfo(server->hostname, str_port, &hints, &ai);
+
+ if (e == 0)
+ {
+ break;
+ }
+ else if (e == EAI_AGAIN)
+ {
+ struct timespec dream, rem;
+
+ dream.tv_nsec= 1000;
+ dream.tv_sec= 0;
+
+ nanosleep(&dream, &rem);
+
+ continue;
+ }
+ else
+ {
+ WATCHPOINT_STRING(server->hostname);
+ WATCHPOINT_STRING(gai_strerror(e));
+ return MEMCACHED_HOST_LOOKUP_FAILURE;
+ }