in reply to Re: Re: porting this 'setnonblocking' subroutine to Windows
in thread porting this 'setnonblocking' subroutine to Windows

Simply use the d/l code link at the bottom of the page and get the module. Then in your pircd directory, make a subdirectory named Portable, then rename the file you downloaded NonBlock.pm and put it in the Portable directory. Open it up and change setnonblock in the @EXPORT_OK declaration to setsocknonblock (Looks like a simple typo, correct me if I'm wrong). Then in the pircd file, put use Portable::NonBlock qw(setsocknonblock); at the top and replace all instances of setnonblocking to setsocknonblock (except for the sub declaration for setnonblocking. You can leave that as it is or take it out). Unfortunately, even though the IRCd will run now, you'll get an error after a user connects, which is "Your vendor has not defined POSIX macro EWOULDBLOCK".

Replies are listed 'Best First'.
(MeowChow) Re4: porting this 'setnonblocking' subroutine to Windows
by MeowChow (Vicar) on Dec 31, 2001 at 06:53 UTC
    You're right, it's a typo, and the code could stand some cleaning up. Regarding the EWOULDBLOCK problem, POSIX::EWOULDBLOCK should probably be set to the same value as EAGAIN. I believe they are synonymous.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      EAGAIN and EWOULDBLOCK are actually different errors, though they are similar enough that many vendors alias one to the other.

      Certainly if one is present and the other is not, then I think the missing should be aliased to the present one. But they should not be assumed to be identical because they aren't always.