gethostbyaddr failure on certain IPs

Started by
1 comment, last by pDK 18 years, 10 months ago
Hey guys, I recently moved my server application from my dev system (192.168.1.100) to another on my network (192.168.1.101). For temp purposes, I used a const varable as my server address. After the move, I updated the const to the correct ip (***.101), but this is failing on me. I tracked down the bug to this function:
LPHOSTENT	CWinsock::GetPTServerAddr()
{
	unsigned long addr;
	CCOMString servername;  //CCOMString - my NON-MFC CString :)

	servername = "192.168.1.101";

	addr = inet_addr(servername);
	return gethostbyaddr((char*)&addr,sizeof(unsigned long),AF_INET);
}
This function freezes on gethostbyaddr for about 20 secs and returns null when 'servername' is anything but "192.168.1.100" or "127.0.0.1"... Is this a system configuration error? If soo... anyway to error trap this? - Eric [edited for bad engrish]
Advertisement
Here is my WSAGetError dump:
Winsock failed with error 11004: The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.


[edited for sanity]
Ohh boy... I'm sorry. I figured it out :).

My other system's cat-5 cable fell out...



Let's just leave it at that.

This topic is closed to new replies.

Advertisement