Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/asyncio/__pycache__/protocols.cpython-311.pyc

�

c��f-���dZdZGd�d��ZGd�de��ZGd�de��ZGd�d	e��ZGd
�de��Zd�Zd
S)zAbstract Protocol base classes.)�BaseProtocol�Protocol�DatagramProtocol�SubprocessProtocol�BufferedProtocolc�.�eZdZdZdZd�Zd�Zd�Zd�ZdS)raCommon base class for protocol interfaces.

    Usually user implements protocols that derived from BaseProtocol
    like Protocol or ProcessProtocol.

    The only case when BaseProtocol should be implemented directly is
    write-only transport like write pipe
    �c��dS)z�Called when a connection is made.

        The argument is the transport representing the pipe connection.
        To receive data, wait for data_received() calls.
        When the connection is closed, connection_lost() is called.
        Nr)�self�	transports  �8/opt/alt/python311/lib64/python3.11/asyncio/protocols.py�connection_madezBaseProtocol.connection_made�����c��dS)z�Called when the connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        Nr�r
�excs  r�connection_lostzBaseProtocol.connection_lostrrc��dS)aCalled when the transport's buffer goes over the high-water mark.

        Pause and resume calls are paired -- pause_writing() is called
        once when the buffer goes strictly over the high-water mark
        (even if subsequent writes increases the buffer size even
        more), and eventually resume_writing() is called once when the
        buffer size reaches the low-water mark.

        Note that if the buffer size equals the high-water mark,
        pause_writing() is not called -- it must go strictly over.
        Conversely, resume_writing() is called when the buffer size is
        equal or lower than the low-water mark.  These end conditions
        are important to ensure that things go as expected when either
        mark is zero.

        NOTE: This is the only Protocol callback that is not called
        through EventLoop.call_soon() -- if it were, it would have no
        effect when it's most needed (when the app keeps writing
        without yielding until pause_writing() is called).
        Nr�r
s r�
pause_writingzBaseProtocol.pause_writing%rrc��dS)zvCalled when the transport's buffer drains below the low-water mark.

        See pause_writing() for details.
        Nrrs r�resume_writingzBaseProtocol.resume_writing;rrN)	�__name__�
__module__�__qualname__�__doc__�	__slots__r
rrrrrrrr	sa���������I����������,����rrc�"�eZdZdZdZd�Zd�ZdS)ranInterface for stream protocol.

    The user should implement this interface.  They can inherit from
    this class but don't need to.  The implementations here do
    nothing (they don't raise exceptions).

    When the user wants to requests a transport, they pass a protocol
    factory to a utility function (e.g., EventLoop.create_connection()).

    When the connection is made successfully, connection_made() is
    called with a suitable transport object.  Then data_received()
    will be called 0 or more times with data (bytes) received from the
    transport; finally, connection_lost() will be called exactly once
    with either an exception object or None as an argument.

    State machine of calls:

      start -> CM [-> DR*] [-> ER?] -> CL -> end

    * CM: connection_made()
    * DR: data_received()
    * ER: eof_received()
    * CL: connection_lost()
    rc��dS)zTCalled when some data is received.

        The argument is a bytes object.
        Nr)r
�datas  r�
data_receivedzProtocol.data_received^rrc��dS�z�Called when the other end calls write_eof() or equivalent.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        Nrrs r�eof_receivedzProtocol.eof_receiveddrrN)rrrrrr!r$rrrrrBsC��������2�I��������rrc�(�eZdZdZdZd�Zd�Zd�ZdS)ra:Interface for stream protocol with manual buffer control.

    Event methods, such as `create_server` and `create_connection`,
    accept factories that return protocols that implement this interface.

    The idea of BufferedProtocol is that it allows to manually allocate
    and control the receive buffer.  Event loops can then use the buffer
    provided by the protocol to avoid unnecessary data copies.  This
    can result in noticeable performance improvement for protocols that
    receive big amounts of data.  Sophisticated protocols can allocate
    the buffer only once at creation time.

    State machine of calls:

      start -> CM [-> GB [-> BU?]]* [-> ER?] -> CL -> end

    * CM: connection_made()
    * GB: get_buffer()
    * BU: buffer_updated()
    * ER: eof_received()
    * CL: connection_lost()
    rc��dS)aPCalled to allocate a new receive buffer.

        *sizehint* is a recommended minimal size for the returned
        buffer.  When set to -1, the buffer size can be arbitrary.

        Must return an object that implements the
        :ref:`buffer protocol <bufferobjects>`.
        It is an error to return a zero-sized buffer.
        Nr)r
�sizehints  r�
get_bufferzBufferedProtocol.get_buffer�rrc��dS)z�Called when the buffer was updated with the received data.

        *nbytes* is the total number of bytes that were written to
        the buffer.
        Nr)r
�nbytess  r�buffer_updatedzBufferedProtocol.buffer_updated�rrc��dSr#rrs rr$zBufferedProtocol.eof_received�rrN)rrrrrr(r+r$rrrrrmsR��������.�I�	�	�	��������rrc�"�eZdZdZdZd�Zd�ZdS)rz Interface for datagram protocol.rc��dS)z&Called when some datagram is received.Nr)r
r �addrs   r�datagram_receivedz"DatagramProtocol.datagram_received�rrc��dS)z~Called when a send or receive operation raises an OSError.

        (Other than BlockingIOError or InterruptedError.)
        Nrrs  r�error_receivedzDatagramProtocol.error_received�rrN)rrrrrr0r2rrrrr�s=������*�*��I�5�5�5�����rrc�(�eZdZdZdZd�Zd�Zd�ZdS)rz,Interface for protocol for subprocess calls.rc��dS)z�Called when the subprocess writes data into stdout/stderr pipe.

        fd is int file descriptor.
        data is bytes object.
        Nr)r
�fdr s   r�pipe_data_receivedz%SubprocessProtocol.pipe_data_received�rrc��dS)z�Called when a file descriptor associated with the child process is
        closed.

        fd is the int file descriptor that was closed.
        Nr)r
r5rs   r�pipe_connection_lostz'SubprocessProtocol.pipe_connection_lost�rrc��dS)z"Called when subprocess has exited.Nrrs r�process_exitedz!SubprocessProtocol.process_exited�rrN)rrrrrr6r8r:rrrrr�sL������6�6��I�������1�1�1�1�1rrc�\�t|��}|r�|�|��}t|��}|std���||kr||d|�<|�|��dS|d|�|d|�<|�|��||d�}t|��}|��dSdS)Nz%get_buffer() returned an empty buffer)�lenr(�RuntimeErrorr+)�protor �data_len�buf�buf_lens     r�_feed_data_to_buffered_protorB�s����4�y�y�H�
�!����x�(�(���c�(�(���	H��F�G�G�G��h���!�C�	��	�N�� � ��*�*�*��F� ��'��N�C����M�� � ��)�)�)�����>�D��4�y�y�H��!�!�!�!�!rN)r�__all__rrrrrrBrrr�<module>rDs���%�%���6�6�6�6�6�6�6�6�r(�(�(�(�(�|�(�(�(�V2�2�2�2�2�|�2�2�2�j�����|����1�1�1�1�1��1�1�1�.!�!�!�!�!r

Hacked By AnonymousFox1.0, Coded By AnonymousFox