C / C++ / MFC
|Vis C/C++ 6.0, Visual Studio
My program is a client to read a web page.
I am successfully setting up the socket.
The following calls and assignments are successful
sa.sin_family = AF_INET;
gethostbyname(gipaddrname); // example yahoo.com
memcpy(&sa.sin_addr, phe->h_addr, phe->h_length);
sa.sin_port = portn; //port 80 converted to net order
socktype = SOCK_STREAM;
sockdes = socket(PF_INET, socktype, ppe->p_proto);
connect(sockdes, (struct sockaddr *)&sa, sizeof(sa));
But when I go to receive the Servers 'hello'
recv(sockdes, pbufbin, len, 0);
I get the error:
WSAECONNABORTED The virtual circuit was terminated due to a time-out or other failure. The application should close the socket as it is no longer usable.
The strange thing is that I have used this exact code for
other servers, such a pop3 mail servers and servers that I wrote, all without a problem....
Any help would be much appreciated
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.