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]
gethostbyaddr failure on certain IPs
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:
Here is my WSAGetError dump:
[edited for sanity]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement