관리-도구
편집 파일: base_protocol.cpython-37.opt-1.pyc
B �k�a� � @ s: d dl Z d dlmZmZ ddlmZ G dd� de j�ZdS )� N)�Optional�cast� )�tcp_nodelayc @ s� e Zd ZdZejdd�dd�Zdd�dd�Zdd�d d �Zdd�dd�Z dd�d d�Z ejdd�dd�Ze e dd�dd�Zdd�dd�ZdS )�BaseProtocol)�_loop�_paused� _drain_waiter�_connection_lost�_reading_paused� transportN)�loop�returnc C s( || _ d| _d | _d| _d| _d | _d S )NF)r r r r r r )�selfr � r �H/opt/alt/python37/lib64/python3.7/site-packages/aiohttp/base_protocol.py�__init__ s zBaseProtocol.__init__)r c C s | j r t�d| _ d S )NT)r �AssertionError)r r r r � pause_writing s zBaseProtocol.pause_writingc C s: | j s t�d| _ | j}|d k r6d | _|�� s6|�d � d S )NF)r r r �done� set_result)r �waiterr r r �resume_writing s zBaseProtocol.resume_writingc C sD | j s@| jd k r@y| j�� W n tttfk r8 Y nX d| _ d S )NT)r r � pause_reading�AttributeError�NotImplementedError�RuntimeError)r r r r r ( s zBaseProtocol.pause_readingc C sD | j r@| jd k r@y| j�� W n tttfk r8 Y nX d| _ d S )NF)r r �resume_readingr r r )r r r r r 0 s zBaseProtocol.resume_reading)r r c C s t tj|�}t|d� || _d S )NT)r �asyncioZ Transportr r )r r Ztrr r r �connection_made8 s zBaseProtocol.connection_made)�excr c C s\ d| _ d | _| jsd S | j}|d kr(d S d | _|�� r:d S |d krN|�d � n |�|� d S )NT)r r r r r r Z set_exception)r r r r r r �connection_lost= s zBaseProtocol.connection_lostc � sJ | j rtd��| jsd S | j}|d kr6| j�� }|| _t�|�I d H d S )NzConnection lost)r �ConnectionResetErrorr r r Z create_futurer Zshield)r r r r r � _drain_helperN s zBaseProtocol._drain_helper)�__name__� __module__�__qualname__� __slots__r ZAbstractEventLoopr r r r r Z BaseTransportr r � BaseExceptionr! r# r r r r r s r )r �typingr r Ztcp_helpersr ZProtocolr r r r r �<module> s