|
IO::Mux::Select - Drop-in replacement for L |
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 the IO::Select manpage that knows how
to deal with the IO::Mux::Handle manpage handles. It also supports real handles so
you can mix the IO::Mux::Handle manpage handles with real handles.
The same interface as the IO::Select manpage is supported, with the following exceptions:
can_read() must read the entire packet before
returning.
the IO::Select manpage, the IO::Mux manpage, the IO::Mux::Handle manpage
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.
|
IO::Mux::Select - Drop-in replacement for L |