IO::Mux::Select - Drop-in replacement for IO::Select when using IO::Mux::Handle objects.
use IO::Mux ; use IO::Mux::Select ; my $mux = new IO::Mux(\*R) ; my $alice = $mux->new_handle() ; open($alice, 'alice') ; my $bob = $mux->new_handle() ; open($bob, 'bob') ; my $ims = new IO::Mux::Select($alice, $bob) ; while(my @ready = $ims->can_read()){ foreach my $h (@ready){ # Do something useful... } }
IO::Mux::Select is a drop-in replacement for IO::Select that knows how to deal with IO::Mux::Handle handles. It also supports real handles so you can mix IO::Mux::Handle handles with real handles.
IO::Mux::Select
The constructor creates a new object and optionally initialises it with a set of handles.
The same interface as IO::Select is supported, with the following exceptions:
This method behaves pretty much like the IO::Select one, except it is not guaranteed that it will return before TIMEOUT seconds. The reason for this is that the IO:Mux::Handle objets handle data in packets, so if data is "detected" on such a handle, can_read() must read the entire packet before returning.
Not implemented.
IO::Select, IO::Mux, IO::Mux::Handle
Patrick LeBoutillier, <patl@cpan.org>
Copyright (C) 2005 by Patrick LeBoutillier
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
To install IO::Mux, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Mux
CPAN shell
perl -MCPAN -e shell install IO::Mux
For more information on module installation, please visit the detailed CPAN module installation guide.