Transports and Protocols — Python 3.16.0a0 documentation

docs.python.org

Tin mới

Python Module Index

3.16.0a0 Documentation

The Python Standard Library

Networking and Interprocess Communication

asyncio — Asynchronous I/O

loop.create_connection()

Transports and Protocols are used by the low-level event loop APIs such as loop.create_connection(). They use callback-based programming style and enable high-performance implementations of network or IPC protocols (e.g.

socket.socket.getpeername()

'peername': the remote address to which the socket is connected, result of socket.socket.getpeername() (None on error)

ssl.SSLSocket.compression()

'compression': the compression algorithm being used as a string, or None if the connection isn’t compressed; result of ssl.SSLSocket.compression()

NotImplementedError

Close the write end of the transport after flushing all buffered data. Data may still be received.

subprocess.Popen.returncode

Return the subprocess return code as an integer or None if it hasn’t returned, which is similar to the subprocess.Popen.returncode attribute.

TCP echo server using streams

The TCP echo server using streams example uses the high-level asyncio.start_server() function.

loop.subprocess_exec() and SubprocessProtocol¶

An example of a subprocess protocol used to get the output of a subprocess and to wait for the subprocess exit.