William G. Davis has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks. Can any Perl networking gurus help me out here?

I'm trying to do non-blocking network IO in Perl.

I need to be able to create a few sockets and try to connect each one in a non-blocking way. Each connect attempt will then be checked periodically, and the sockets that get connected successfully will be added to a list. I then need to periodically select() the connected sockets from the list to check for readability and writability, and do non-blocking reads and non-blocking writes to each socket as needed.

My questions are as follows:

Any replies are greatly appreciated.

Replies are listed 'Best First'.
Re: Non-blocking network IO in Perl?
by tachyon (Chancellor) on Aug 19, 2004 at 08:46 UTC

      Ah, I knew it wouldn't be that simple to just use IO::Socket. I'll copy and adapt that code. Thanks tachyon.

        It *is* simple, unless you are on Win32 which of course is known to make the simple things hard and the hard things harder AOTBE. You may find that threading is a better option if you are on Win32.

        cheers

        tachyon