Asynchat
view release on metacpan or search on metacpan
lib/Asynchat.pm view on Meta::CPAN
}
package Asynchat::SimpleProducer;
#==============================================================================
#
# FILE: Asynchat.pm
# PACKAGE: Asynchat::SimpleProducer
#
# DESCRIPTION:
#
# FILES: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: (Sebastiano Piccoli), <sebastiano.piccoli@gmail.com>
# COMPANY:
# VERSION: 0.1
# CREATED: 08/02/13 14:34:00 CEST
# REVISION: ---
#==============================================================================
use strict;
use warnings;
sub init {
my $self = shift;
# todo
}
sub more {
my $self = shift;
# todo
}
1;
__END__
=head1 NAME
Asynchat - used as base class of Asyncore to simplify to handle protocols
=head1 SYNOPSIS
use base qw( Asynchat );
my $channel = Subclass->new($addr, $port);
$channel->handle_connect( ... )
$channel->collect_incoming_data( ... );
$channel->found_terminator( ... )
=head1 DESCRIPTION
Asynchat builds on Asyncore, simplifying asynchronous clients and servers and making it easier to handle protocols whose elements are terminated by arbitrary strings, or are of variable length.
Asyncore is a basic infrastructure for asyncronous socket programming. It provides an implementation of "reactive socket" and it provides hooks for handling events. Code must be written into these hooks (handlers).
Asynchat is intended as an abstract class. Override collect_incoming_data() and found_terminator() in a subclass to provide the implementation of the protocol you are writing.
See the folder <i>script</i> for a complete example on the correct use of this module.
=head1 METHODS
=head2 collect_incoming_data($data)
=head2 set_terminator($string)
=head2 get_terminator()
=head2 found_terminator()
=head2 push_direct($data)
=head2 push_with_producer($data)
=head2 close_when_done()
=head1 ACKNOWLEDGEMENTS
This module is a porting of asynchat.py written in python.
=head1 LICENCE
LGPL
( run in 0.633 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )