fhandler_socket::accept() and FIONBIO

Thomas Pfaff tpfaff@gmx.net
Wed Aug 7 03:10:00 GMT 2002



On Wed, 7 Aug 2002, Conrad Scott wrote:

> "Thomas Pfaff" <tpfaff@gmx.net> wrote:
> >
> > On Wed, 7 Aug 2002, Conrad Scott wrote:
> >
> > > I've attached a tiny patch to fix the win98 / WSAENOBUFS
> problem
> > > reported in
> > > http://cygwin.com/ml/cygwin-developers/2002-07/msg00167.html
> > > (amongst other places).
> > >
> > > It turns out to be a minor ding in setting the socket back to
> > > non-blocking in the (blocking) accept call.  Quite why this
> has
> > > the effect it does on win98, I'll leave to the morning.  This
> > > patch fixes the problem and is obviously the right thing to
> do:
> > > the details I'm happy to leave 'til later.
> >
> > Unfortunately it has worked on NT. Don't know why.
>
> Yes, and if I've got the energy today, I might try and understand
> what was going wrong on win98.  AFAICT the socket was being left
> non-blocking but since the fhandler thought it was blocking, this
> wasn't generally visible.  Perhaps *0 on NT systems is != 0 but on
> 9x systems it's == 0.
>
> London's promised rain every day until the end of the weekend at
> the earliest so I might yet have the opportunity to look more at
> this :-(

Do not waste your time. You did the right thing and i was wrong.
According to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/ovrspi3_6whe.asp
you must pass an unsigned long pointer to ioctlsocket for the FIONBIO
opcode.

Thomas




More information about the Cygwin-patches mailing list