[PATCH] Re: [corinna-cygwin@cygwin.com: Re: ENOTSOCK errors with cygwin dll 1.3.21 and 1.3.22]
Thomas Pfaff
tpfaff@gmx.net
Tue May 27 08:20:00 GMT 2003
On Tue, 27 May 2003, Corinna Vinschen wrote:
> Hi Thomas,
>
> On Tue, May 27, 2003 at 09:15:10AM +0200, Thomas Pfaff wrote:
> > * fhandler_socket.cc (sock_event::~sock_event): New method.
> > (sock_event::load): Change to void. Check if winsock2 is available.
> > (socke_event::wait): Return 0 if interruptible mode is not available.
> > (fhandler_socket::connect): Remove checks for winsock2 availability.
> > (fhandler_socket::accept): Ditto.
>
> that looks pretty good, just...
>
> > --- fhandler_socket.cc.org 2003-05-26 16:08:16.000000000 +0200
> > +++ fhandler_socket.cc 2003-05-27 09:05:38.000000000 +0200
> > @@ -131,31 +131,44 @@ public:
> > ev[0] = WSA_INVALID_EVENT;
> > ev[1] = signal_arrived;
> > }
> > - bool load (SOCKET sock, int type_bit)
> > + ~sock_event ()
> > {
> > - if ((ev[0] = WSACreateEvent ()) == WSA_INVALID_EVENT)
> > - return false;
> > + if (ev[0] != WSA_INVALID_EVENT)
> > + CloseHandle (ev[0]);
> ^^^^^^^^^^^
> ...shouldn't that be a WSACloseEvent?
>
> > + }
>
Of course you are right. I have fixed this.
In reality this shouldn't make any difference since WSACreateEvent will use
CreateEvent and the handles are therefore compatible.
In another project i have used CreateEvent to create an event that was used with
WSAEventSelect because i had to create it in a constructor before WSAStartup
and it worked the same way.
Thomas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fhandler_socket.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20030527/67efafff/attachment.ksh>
More information about the Cygwin-patches
mailing list