AnyEvent-PacketReader

 view release on metacpan or  search on metacpan

lib/AnyEvent/PacketReader.pm  view on Meta::CPAN

for my $dir (qw(> <)) {
    for my $t (qw(S L Q)) {
        $header_length{"$t$dir"} = $header_length{$t};
    }
}

my %short_templ = map { $_ => $_ } keys %header_length;
my %load_offset = %header_length;
my $good_packers = join '', keys %header_length;

use Data::Dumper;
$SIG{INT} = sub {
    print Data::Dumper->Dump([\%short_templ, \%header_length, \%load_offset], [qw(%short_templ %header_length %load_offset)]);
    exit 1;
};

sub packet_reader {
    my $cb = pop;
    my ($fh, $templ, $max_total_length) = @_;
    croak 'Usage: packet_reader($fh, [$templ, [$max_total_length,]] $callback)'
        unless defined $fh and defined $cb;

    $max_total_length ||= $MAX_TOTAL_LENGTH;



( run in 0.480 second using v1.01-cache-2.11-cpan-4d50c553e7e )