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

uhh MeowChow that seems to be exactly what i need in order to port this irc daemon to Windows. But I'm having a little trouble. Any chance I can pay you to put that part of the code in my script exactly as it should be?

Ed@ChristianWeb.com

  • Comment on Re: Re: porting this 'setnonblocking' subroutine to Windows

Replies are listed 'Best First'.
Re: Re: Re: porting this 'setnonblocking' subroutine to Windows
by Veachian64 (Scribe) on Dec 31, 2001 at 02:46 UTC
    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".
      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.