cmt::ios - I/O Stream
use cmt::ios; my $ios = new ioevt( group1 => [ $fd1, $fd2, ... ], group2 => ..., -read => sub { shift; $buf=<shift>; return $wbuf }, -write => sub { shift; print <shift> $wbuf; }, -err => sub { shift; $fd=<shift>; $fd->shutdown; remove($fd)... } -or- sub { my $ctx = shift; $ctx->exit unless $stream->err(shift) } ); 1 $ios->loop(@read_fds, @write_fds, @err_fds); 2 my $ctx = $ios->create_context(@read_fds, @write_fds, @err_fds); while ($ctx->iterate); 3 while ($ctx->iterate) { # ... if (connect_command) { $ios = $ios->merge(new cmt::ios(...)); $ctx = $ios->create_context; } } 4 $mios = $ios->merge(); $mctx = $mios->create_context; while ($mctx->iterate) { if (connect_command) { $sock = new socket; $mios->merge(new cmt::ios(GROUP=>[$sock], ...)); $mctx->add($sock); } } 5 new cmt::ios { -read = { my ($ctx, $sock) = @_; if (connect_command) { new socket; $ctx->add($socket); } } }
cmt::ios is a WHAT used for WHAT. It HOW-WORKS.
BACKGROUND-PROBLEM.
HOW-cmt::ios-RESOLVES.
(No Information)
The initial version.
The "I/O Stream" in cmt
Xima Lenik <name@mail.box>
To install cmt::g, copy and paste the appropriate command in to your terminal.
cpanm
cpanm cmt::g
CPAN shell
perl -MCPAN -e shell install cmt::g
For more information on module installation, please visit the detailed CPAN module installation guide.