tezvyn:

asyncio Streams: High-Level Async Network I/O

Source: python.readthedocs.iointermediate

asyncio Streams are like async file handles for the network. You get a reader/writer pair to await data, simplifying TCP clients and servers for basic protocols. The footgun: the default buffer limit is small; reading large data will fail unexpectedly.

asyncio Streams treat a network connection like an async file. Instead of low-level transports, you get a simple `(reader, writer)` pair to work with. This is perfect for building straightforward TCP clients and servers for custom protocols. The footgun: the default buffer limit is small; reading a message larger than the limit (e.g., 64KB) raises a `LimitOverrunError` instead of returning data. You must explicitly set a higher limit.

Read the original → python.readthedocs.io

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

asyncio Streams: High-Level Async Network I/O · Tezvyn