I have a problem where I need to determine if the host exists prior to connecting to it. This host does not work with the function gethostbyaddr() because it is not PC-based and does not return host information. It is IP-based only. Whenever I try to call gethostbyaddr() on the IP address, WinSock returns 11004 (WSANODATA).
Is there a similar function (besides ping) to determine if an IP is valid before trying to connect?
I solved the problem by using the built-in Windows API for PING. I changed the
gethostbyname()toinet_addr.shown here: ICMP.DLL Method
dllping.cpp
icmpdefs.h