Jump to content
  • Advertisement
Sign in to follow this  
pDK

gethostbyaddr failure on certain IPs

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!