Asynchat - used as base class of Asyncore to simplify to handle protocols
use base qw( Asynchat ); my $channel = Subclass->new($addr, $port); $channel->handle_connect( ... ) $channel->collect_incoming_data( ... ); $channel->found_terminator( ... )
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.
This module is a porting of asynchat.py written in python.