asynchat

The asynchat module simplifies the implementation of applications that implement asynchronous networking using the asyncore module. This module extends the capabilities of the dispatcher class in asyncore by adding some features that make it easier to handle protocols based on a simple request/response mechanism (for example, HTTP).

To use this module, you must define a class that inherits from async_chat. Within this class, you must define two methods: collect_incoming_data() and found_terminator(). The first method is invoked whenever data is received on the network connection. Typically, it would simply take the data and store it someplace. The found_terminator() method is called when the end of a command request has been detected. ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.