B
7Acg
@ s d Z ddlZeedre d7 Z ddlmZ ddlmZ ddlmZ dd lmZ dd
l m
Z
dZG dd
d
eZ
G dd deZd!dedddZd"dedddZeedrd#dedddZd$dedddZG dd dejZG dd deejZG dd dZG dd d ZdS )%)StreamReaderStreamWriterStreamReaderProtocolopen_connectionstart_serverIncompleteReadErrorLimitOverrunError NZAF_UNIX)open_unix_connectionstart_unix_server )
coroutines)events) protocols)logger)sleepi c s( e Zd ZdZ fddZdd Z ZS )r z
Incomplete read error. Attributes:
- partial: read bytes string before the end of stream was reached
- expected: total number of expected bytes (or None if unknown)
c s, t t| d|d || _|| _d S )Nz bytes read on a total of z expected bytes)super__init__lenpartialexpected)selfr r ) __class__ 4/opt/alt/python37/lib64/python3.7/asyncio/streams.pyr s zIncompleteReadError.__init__c C s t | | j| jffS )N)typer r )r r r r
__reduce__# s zIncompleteReadError.__reduce__)__name__
__module____qualname____doc__r r
__classcell__r r )r r r s r c s( e Zd ZdZ fddZdd Z ZS )r zReached the buffer limit while looking for a separator.
Attributes:
- consumed: total number of to be consumed bytes.
c s t | || _d S )N)r r consumed)r messager! )r r r r - s zLimitOverrunError.__init__c C s t | | jd | jffS )Nr )r argsr! )r r r r r 1 s zLimitOverrunError.__reduce__)r r r r r r r r r )r r r ' s r )looplimitc sb |dkrt }t||d}t||d |j fdd| |f|I dH \}}t| ||}||fS )a A wrapper for create_connection() returning a (reader, writer) pair.
The reader returned is a StreamReader instance; the writer is a
StreamWriter instance.
The arguments are all the usual arguments to create_connection()
except protocol_factory; most common are positional host and port,
with various optional keyword arguments following.
Additional optional keyword arguments are loop (to set the event loop
instance to use) and limit (to set the buffer limit passed to the
StreamReader).
(If you want to customize the StreamReader and/or
StreamReaderProtocol classes, just copy the code -- there's
really nothing special here except some convenience.)
N)r% r$ )r$ c s S )Nr r )protocolr r