Tin mới
Networking and Interprocess Communication
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.
'peername': the remote address to which the socket is connected, result of socket.socket.getpeername() (None on error)
'compression': the compression algorithm being used as a string, or None if the connection isn’t compressed; result of ssl.SSLSocket.compression()
Close the write end of the transport after flushing all buffered data. Data may still be received.
Return the subprocess return code as an integer or None if it hasn’t returned, which is similar to the subprocess.Popen.returncode attribute.
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.