asyncio.StreamReader.readexactly()

coroutine readexactly(n) Read exactly n bytes. Raise an IncompleteReadError if the end of the stream is reached before n can be read, the IncompleteReadError.partial attribute of the exception contains the partial read bytes. This method is a coroutine.

asyncio.StreamReader.read()

coroutine read(n=-1) Read up to n bytes. If n is not provided, or set to -1, read until EOF and return all read bytes. If the EOF was received and the internal buffer is empty, return an empty bytes object. This method is a coroutine.

asyncio.StreamReader.feed_eof()

feed_eof() Acknowledge the EOF.

asyncio.StreamReader.feed_data()

feed_data(data) Feed data bytes in the internal buffer. Any operations waiting for the data will be resumed.

asyncio.StreamReader.exception()

exception() Get the exception.

asyncio.StreamReader.at_eof()

at_eof() Return True if the buffer is empty and feed_eof() was called.

asyncio.StreamReader

class asyncio.StreamReader(limit=None, loop=None) This class is not thread safe. exception() Get the exception. feed_eof() Acknowledge the EOF. feed_data(data) Feed data bytes in the internal buffer. Any operations waiting for the data will be resumed. set_exception(exc) Set the exception. set_transport(transport) Set the transport. coroutine read(n=-1) Read up to n bytes. If n is not provided, or set to -1, read until EOF and return all read bytes. If the EO

asyncio.start_unix_server()

coroutine asyncio.start_unix_server(client_connected_cb, path=None, *, loop=None, limit=None, **kwds) Start a UNIX Domain Socket server, with a callback for each client connected. See start_server() for information about return value and other details. This function is a coroutine. Availability: UNIX.

asyncio.start_server()

coroutine asyncio.start_server(client_connected_cb, host=None, port=None, *, loop=None, limit=None, **kwds) Start a socket server, with a callback for each client connected. The return value is the same as create_server(). The client_connected_cb parameter is called with two parameters: client_reader, client_writer. client_reader is a StreamReader object, while client_writer is a StreamWriter object. The client_connected_cb parameter can either be a plain callback function or a coroutine fun

asyncio.sleep()

coroutine asyncio.sleep(delay, result=None, *, loop=None) Create a coroutine that completes after a given time (in seconds). If result is provided, it is produced to the caller when the coroutine completes. The resolution of the sleep depends on the granularity of the event loop. This function is a coroutine.