The module simplifies asynchronous clients and servers based on Asyncore and makes it easier for elements to handle the protocol that ends with arbitrary strings, or is variable-length. It provides an abstract class Async_chat, which provides the Collect_incoming_data () and found_terminator () methods. In the same way as Asyncore, there are 2 channels: Asyncore.dispatcher and Asynchat.async_chat, which can be used to mix channels freely. Typically the Asyncore.dispatcher server channel produces a new Asynchat.async_chat channel object when a connection request is received.
Interface:
class Asynchat.async_chat: Abstract subclass of Asyncore.dispatcher. The Asyncore_chat method is as follows:
Async_chat.close_when_done ():
Async_chat.collect_incoming_data (data):
async_chat.discard_buffers ():
Async_chat.found_terminator ():
Async_chat.get_terminator ():
async_chat.push (data):
async_chat.push_with_producer (producer):
async_chat.set_terminator (term):
class Asynchat.fifo ([List=none]):: Auxiliary class. The Asynchat.fifo method is as follows
is_empty ():
first ():
push ():
pop ()