Sign in to follow this  

gethostbyaddr failure on certain IPs

Recommended Posts

Hey guys, I recently moved my server application from my dev system ( to another on my network ( 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 = "";

	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 "" or ""... Is this a system configuration error? If soo... anyway to error trap this? - Eric [edited for bad engrish]

Share this post

Link to post
Share on other sites
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]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this