getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);By the way, if your not already, you should replace your gethostbyname() and getservbyname() calls with getaddrinfo(). getaddrinfo() is portable and protocol agnostic. Some other good tips can be found here.
This is my blogchalk: United States, Oklahoma, Tulsa, Midtown, English, Austin Gilbert, Male, 26-30, computer science, photography.