Re: [CODE] Socket Problems

From: Cj Stremick (stremick@IX.NETCOM.COM)
Date: 11/04/98


Pulled from MSDN...

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

...and SOCKET_ERROR = -1 in WinSock world just like Unix sockets.

Since you are using MSVC (and C++ features), you could also use MFC
(CAsyncSocket or CSocket) if you aren't worried about portability.  It's
pretty handy.

-Cj



-----Original Message-----
From: Sammy <samedi@DHC.NET>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Wednesday, November 04, 1998 9:46 AM
Subject: Re:  [CODE] Socket Problems


>
>This would be a good time to learn how to use your MSVC documentation.
>Searching for "connect" will bring you to the connect API specification,
which
>says that your -1 means a successful connection.
>
>What you really ought to be looking at is the return from socket(), which
is
>the real failure here.  The documentation for "socket" will tell you how to
>find out why the failure occurred, and will also have a link to the API
call
>you need to use before socket().  That doc even provides sample code
showing
>you exactly how to correctly set up a socket in windows.
>
>Sam
>
>
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>     +------------------------------------------------------------+
>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST