asyncio.StreamWriter.get_extra_info()

get_extra_info(name, default=None) Return optional transport information: see BaseTransport.get_extra_info().

asyncio.StreamWriter.drain()

coroutine drain() Let the write buffer of the underlying transport a chance to be flushed. The intended use is to write: w.write(data) yield from w.drain() When the size of the transport buffer reaches the high-water limit (the protocol is paused), block until the size of the buffer is drained down to the low-water limit and the protocol is resumed. When there is nothing to wait for, the yield-from continues immediately. Yielding from drain() gives the opportunity for the loop to schedule t

asyncio.StreamWriter.close()

close() Close the transport: see BaseTransport.close().

asyncio.StreamWriter.can_write_eof()

can_write_eof() Return True if the transport supports write_eof(), False if not. See WriteTransport.can_write_eof().

asyncio.StreamWriter

class asyncio.StreamWriter(transport, protocol, reader, loop) Wraps a Transport. This exposes write(), writelines(), can_write_eof(), write_eof(), get_extra_info() and close(). It adds drain() which returns an optional Future on which you can wait for flow control. It also adds a transport attribute which references the Transport directly. This class is not thread safe. transport Transport. can_write_eof() Return True if the transport supports write_eof(), False if not. See WriteTra

asyncio.StreamReaderProtocol

class asyncio.StreamReaderProtocol(stream_reader, client_connected_cb=None, loop=None) Trivial helper class to adapt between Protocol and StreamReader. Subclass of Protocol. stream_reader is a StreamReader instance, client_connected_cb is an optional function called with (stream_reader, stream_writer) when a connection is made, loop is the event loop instance to use. (This is a helper class instead of making StreamReader itself a Protocol subclass, because the StreamReader has other potentia

asyncio.StreamReader.set_transport()

set_transport(transport) Set the transport.

asyncio.StreamReader.set_exception()

set_exception(exc) Set the exception.

asyncio.StreamReader.readuntil()

coroutine readuntil(separator=b'n') Read data from the stream until separator is found. On success, the data and separator will be removed from the internal buffer (consumed). Returned data will include the separator at the end. Configured stream limit is used to check result. Limit sets the maximal length of data that can be returned, not counting the separator. If an EOF occurs and the complete separator is still not found, an IncompleteReadError exception will be raised, and the internal

asyncio.StreamReader.readline()

coroutine readline() Read one line, where “line” is a sequence of bytes ending with \n. If EOF is received, and \n was not found, the method will return the partial read bytes. If the EOF was received and the internal buffer is empty, return an empty bytes object. This method is a coroutine.