WinSock function "connect" returns unknown error 
Author Message
 WinSock function "connect" returns unknown error

Hello,
     I am trying to connect to a host computer using the WinSock function,
connect, but, the function returns an error of -1.  This error is not
covered in the MSDN help files.  Prior to calling connect, I successfully
created a socket by making the following call: hSock = ::socket(AF_INET,
SOCK_STREAM, 0);.  I then called WSAAsyncGetHostByName (m_hWnd,
WSCB_GETHOST, host, (char FAR *) pm_szBuf, 2048);  which was also
successful.  Any ideas of what I'm not doing correctly?

Sincere Regards,
Tom



Sat, 11 Aug 2001 03:00:00 GMT  
 WinSock function "connect" returns unknown error

Quote:

>     I am trying to connect to a host computer using the WinSock function,
>connect, but, the function returns an error of -1.  This error is not
>covered in the MSDN help files.

Yeah, it is. This is what the docs say:

"If no error occurs, connect returns zero. Otherwise, it returns
SOCKET_ERROR, and a specific error code may be retrieved by calling
WSAGetLastError."

SOCKET_ERROR is defined to be -1.

Regards,
Will



Sat, 11 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. RPC "Unknown protocol" error

2. "unknown size" error

3. Unknown Error "Application timed out"???

4. "Unknown Error" from using GetHostByName

5. C# XsltContext for "unknown function" current()

6. Function without a "return type"?

7. lint warning "function actually returns double"

8. Error "free"-ing "malloc"-ed memory

9. Q : What is returned by "return;"

10. can't find "unknown.idl"

11. Call to js function from VC++ returns "unknown name" ONLY in event sink callback function

12. itoa function caused "conflicting types" error

 

 
Powered by phpBB® Forum Software