IO::Mux - Multiplex several virtual streams over a real pipe/socket
Example:
use IO::Mux ;
pipe(R, W) ;
if (fork){
my $mux = new IO::Mux(\*W) ;
my $alice = $mux->new_handle() ;
open($alice, 'alice') ;
my $bob = $mux->new_handle() ;
open($bob, 'bob') ;
print $alice "Hi Alice!\n" ;
print $bob "Hi Bob!\n" ;
}
else {
my $mux = new IO::Mux(\*R) ;
my $alice = $mux->new_handle() ;
open($alice, 'alice') ;
my $bob = $mux->new_handle() ;
open($bob, 'bob') ;
print scalar(<$bob>) ;
print scalar(<$alice>) ;
}
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
COPYRIGHT AND LICENCE
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.