Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4827 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

I'm writing a program to download files using the http protacole. I wrote a console version a while back, and I got it working. Now I have upgraded to visual studio 2005 beta 2. Now I have my Hostname as a char *, and I use the code if (inet_addr(CHostName) == INADDR_NONE) { hp = gethostbyname(CHostName); } else { unsigned int addr = inet_addr(CHostName); hp = gethostbyaddr((char*)&addr,sizeof(addr),AF_INET); } if (hp == NULL) { DWORD a = WSAGetLastError(); MessageBox(NULL,_T("Error getting host"),_T("ERROR"),MB_OK|MB_ICONSTOP); closesocket(soc); return false; } If CHostName is = to "HTTP://DOWNLOAD.WINZIP.COM/" hp = NULL, and a = 1104 (WSANO_DATA) If CHostName is = to "HTTP://fjgdflgkgfdsrtdeugi/" hp = NULL, and a = 1104 (WSANO_DATA) msdn says: Valid name, no data record of requested type. The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable. now, download.winzip.com exists, try http://download.winzip.com/winzip90.exe and fjgdflgkgfdsrtdeugi does not exist. but I still get this error. Any ideas?

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!