IO::Mux::Select - Drop-in replacement for L<IO::Select> when using L<IO::Mux::Handle> objects.


SYNOPSIS

  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...
    }
  }


DESCRIPTION

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.


CONSTRUCTOR

new ( [ HANDLES ] )

The constructor creates a new object and optionally initialises it with a set of handles.


METHODS

The same interface as the IO::Select manpage is supported, with the following exceptions:

can_read ( [ TIMEOUT ] )

This method behaves pretty much like the the IO::Select manpage one, except it is not guaranteed that it will return before TIMEOUT seconds. The reason for this is that the the IO:Mux::Handle manpage objets handle data in packets, so if data is "detected" on such a handle, can_read() must read the entire packet before returning.

can_write ( [ TIMEOUT ] )

Not implemented.

has_exception ( [ TIMEOUT ] )

Not implemented.

bits ()

Not implemented.

select ( READ, WRITE, EXCEPTION [, TIMEOUT ] )

Not implemented.


SEE ALSO

the IO::Select manpage, the IO::Mux manpage, the IO::Mux::Handle manpage


AUTHOR

Patrick LeBoutillier, <patl@cpan.org>


COPYRIGHT AND LICENSE

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.