If you're reading this, you've probably already noticed that Windows doesn't have an inet_ntop() implementation. So the way to do this is to use getnameinfo() instead. The synopsis is listed below. You'll want to use pass ( NI_NUMERICSERV | NI_NUMERICHOST ) as the flag argument.
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.

 

Add to My Yahoo!

Add to Google

Subscribe with Bloglines

Austin Gilbert/Male/26-30. Lives in United States/Oklahoma/Tulsa/Midtown, speaks English. Spends 40% of daytime online. Uses a Fast (128k-512k) connection. And likes computer science/photography.
This is my blogchalk: United States, Oklahoma, Tulsa, Midtown, English, Austin Gilbert, Male, 26-30, computer science, photography.

inet_ntop() implementation for Windows
2005/09/13