Sign in to follow this  
crazy_andy

WSANO_DATA

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

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