More on frameworks

I've broken from our usual procedural form and used an object-oriented approach in the last example for two reasons. First, although it is possible to write a purely procedural style server with asyncio, it requires a deeper understanding of co-routines than what we were able to provide here. If you're curious, then you can go through an example co-routine style echo server, which is in the asyncio documentation at https://docs.python.org/3/library/asyncio-stream.html#asyncio-tcp-echo-server-streams.

The second reason is that this kind of class-based approach is generally a more manageable model to follow in a full system.

There is in fact a new module called selectors in Python 3.4, which provides an API for quickly building ...

Get Learning Python Network Programming 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.