§
    ¨öÉgG  ã                   óx   — d Z ddlmZmZmZ ddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ dZ G d	„ d
¦  «        ZdZdS )z.
wsproto
~~~~~~~

A WebSocket implementation.
é    )Ú	GeneratorÚOptionalÚUnioné   )Ú
ConnectionÚConnectionStateÚConnectionType)ÚEvent)ÚH11Handshake)ÚHeadersz1.2.0c                   ó¬   — e Zd ZdZdeddfd„Zedefd„¦   «         Zde	de
eef         ddfd	„Zd
edefd„Zdee         ddfd„Zdeeddf         fd„ZdS )ÚWSConnectionzN
    Represents the local end of a WebSocket connection to a remote peer.
    Úconnection_typeÚreturnNc                 ób   — |t           j        u | _        t          |¦  «        | _        d| _        dS )z­
        Constructor

        :param wsproto.connection.ConnectionType connection_type: Controls
            whether the library behaves as a client or as a server.
        N)r	   ÚCLIENTÚclientr   Ú	handshakeÚ
connection)Úselfr   s     ú\/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/site-packages/wsproto/__init__.pyÚ__init__zWSConnection.__init__   s-   € ð &­Ô)>Ð>ˆŒÝ% oÑ6Ô6ˆŒØ04ˆŒˆˆó    c                 ó@   — | j         €| j        j        S | j         j        S )z_
        :returns: Connection state
        :rtype: wsproto.connection.ConnectionState
        )r   r   Ústate©r   s    r   r   zWSConnection.state!   s"   € ð Œ?Ð"Ø”>Ô'Ð'ØŒÔ$Ð$r   ÚheadersÚpathc                 ó<   — | j                              ||¦  «         d S )N)r   Úinitiate_upgrade_connection)r   r   r   s      r   r    z(WSConnection.initiate_upgrade_connection+   s"   € ð 	Œ×2Ò2°7¸DÑAÔAÐAÐAÐAr   Úeventc                 ó°   — d}| j         €/|| j                             |¦  «        z  }| j        j         | _         n|| j                              |¦  «        z  }|S )a‹  
        Generate network data for the specified event.

        When you want to communicate with a WebSocket peer, you should construct
        an event and pass it to this method. This method will return the bytes
        that you should send to the peer.

        :param wsproto.events.Event event: The event to generate data for
        :returns bytes: The data to send to the peer
        r   )r   r   Úsend)r   r!   Údatas      r   r#   zWSConnection.send0   sX   € ð ˆØŒ?Ð"Ø�D”N×'Ò'¨Ñ.Ô.Ñ.ˆDØ"œnÔ7ˆDŒOˆOà�D”O×(Ò(¨Ñ/Ô/Ñ/ˆDØˆr   r$   c                 ó¢   — | j         €-| j                             |¦  «         | j        j         | _         dS | j                              |¦  «         dS )zý
        Feed network data into the connection instance.

        After calling this method, you should call :meth:`events` to see if the
        received data triggered any new events.

        :param bytes data: Data received from remote peer
        N)r   r   Úreceive_data)r   r$   s     r   r&   zWSConnection.receive_dataC   sN   € ð Œ?Ð"ØŒN×'Ò'¨Ñ-Ô-Ð-Ø"œnÔ7ˆDŒOˆOˆOàŒO×(Ò(¨Ñ.Ô.Ð.Ð.Ð.r   c              #   ó˜   K  — | j                              ¦   «         E d{V —† | j        �!| j                             ¦   «         E d{V —† dS dS )z”
        A generator that yields pending events.

        Each event is an instance of a subclass of
        :class:`wsproto.events.Event`.
        N)r   Úeventsr   r   s    r   r(   zWSConnection.eventsR   sj   è è € ð ”>×(Ò(Ñ*Ô*Ð*Ð*Ð*Ð*Ð*Ð*Ð*ØŒ?Ð&Ø”×-Ò-Ñ/Ô/Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ð/Ð/ð 'Ð&r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   Úpropertyr   r   r   r   ÚbytesÚstrr    r
   r#   r   r&   r   r(   © r   r   r   r      s  € € € € € ðð ð	5¨ð 	5¸4ð 	5ð 	5ð 	5ð 	5ð ð%�ð %ð %ð %ñ „Xð%ðBØðBØ&+¨E°3¨JÔ&7ðBà	ðBð Bð Bð Bð
˜%ð  Eð ð ð ð ð&/ ¨%¤ð /°Tð /ð /ð /ð /ð	0˜	 %¨¨tÐ"3Ô4ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0r   r   )r	   r   N)r,   Útypingr   r   r   r   r   r   r	   r(   r
   r   r   r   Ú__version__r   Ú__all__r0   r   r   ú<module>r4      sÄ   ððð ð .Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -à CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CÐ CØ Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð à€ðJ0ð J0ð J0ð J0ð J0ñ J0ô J0ð J0ðZ -€€€r   