The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

cmt::ios - I/O Stream

SYNOPSIS

    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); 
            }
        }
    }

DESCRIPTION

cmt::ios is a WHAT used for WHAT. It HOW-WORKS.

BACKGROUND-PROBLEM.

HOW-cmt::ios-RESOLVES.

SUB-PACKAGE

METHOD

DIAGNOSTICS

(No Information)

HISTORY

0.x

The initial version.

SEE ALSO

The "I/O Stream" in cmt

AUTHOR

Xima Lenik <name@mail.box>