+static memcached_return set_hostinfo(memcached_server_st *server)
+{
+ struct addrinfo *ai;
+ struct addrinfo hints;
+ int e;
+ char str_port[NI_MAXSERV];
+
+ sprintf(str_port, "%u", server->port);
+
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family= AF_INET;
+ hints.ai_socktype= SOCK_STREAM;
+ hints.ai_protocol= 0;
+
+ e= getaddrinfo(server->hostname, str_port, &hints, &ai);
+ if (e != 0)
+ {
+ WATCHPOINT_STRING(server->hostname);
+ WATCHPOINT_STRING(gai_strerror(e));
+ return MEMCACHED_HOST_LOOKUP_FAILURE;
+ }