§
    !ß·i8#  ã                   óH   — d dl Z d dlmZ d dlmZmZmZ  G d„ d¦  «        ZdS )é    N)ÚAsyncClient)ÚSocketIOErrorÚTimeoutErrorÚDisconnectedErrorc                   ó†   — e Zd ZdZeZd„ Zi dddddfd„Zed„ ¦   «         Z	ed	„ ¦   «         Z
dd
„Zdd„Zdd„Zd„ Zd„ Zd„ ZdS )ÚAsyncSimpleClienta+  A Socket.IO client.

    This class implements a simple, yet fully compliant Socket.IO web client
    with support for websocket and long-polling transports.

    The positional and keyword arguments given in the constructor are passed
    to the underlying :func:`socketio.AsyncClient` object.
    c                 óº   — || _         || _        d | _        d| _        t	          j        ¦   «         | _        d| _        t	          j        ¦   «         | _        g | _	        d S )Nú/F)
Úclient_argsÚclient_kwargsÚclientÚ	namespaceÚasyncioÚEventÚconnected_eventÚ	connectedÚinput_eventÚinput_buffer)ÚselfÚargsÚkwargss      úa/home/mmwave/public_html/mmwave/venv/lib/python3.11/site-packages/socketio/async_simple_client.pyÚ__init__zAsyncSimpleClient.__init__   sQ   € ØˆÔØ#ˆÔØˆŒØˆŒÝ&œ}™œˆÔØˆŒÝ"œ=™?œ?ˆÔØˆÔÐÐó    Nr
   z	socket.ioé   c           	   ƒ   óh  ‡ K  — ‰ j         rt          d¦  «        ‚|‰ _        g ‰ _        ‰ j                             ¦   «           ‰ j        ‰ j        i ‰ j        ¤Ž‰ _	        ‰ j	         
                    ‰ j        ¬¦  «        ˆ fd„¦   «         }‰ j	         
                    ‰ j        ¬¦  «        ˆ fd„¦   «         }	‰ j	         
                    ‰ j        ¬¦  «        ˆ fd„¦   «         }
‰ j	                             d‰ j        ¬¦  «        ˆ fd„¦   «         }‰ j	                             |||||g||¬¦  «        ƒ d	{V —† d	S )
aH  Connect to a Socket.IO server.

        :param url: The URL of the Socket.IO server. It can include custom
                    query string parameters if required by the server. If a
                    function is provided, the client will invoke it to obtain
                    the URL each time a connection or reconnection is
                    attempted.
        :param headers: A dictionary with custom headers to send with the
                        connection request. If a function is provided, the
                        client will invoke it to obtain the headers dictionary
                        each time a connection or reconnection is attempted.
        :param auth: Authentication data passed to the server with the
                     connection request, normally a dictionary with one or
                     more string key/value pairs. If a function is provided,
                     the client will invoke it to obtain the authentication
                     data each time a connection or reconnection is attempted.
        :param transports: The list of allowed transports. Valid transports
                           are ``'polling'`` and ``'websocket'``. If not
                           given, the polling transport is connected first,
                           then an upgrade to websocket is attempted.
        :param namespace: The namespace to connect to as a string. If not
                          given, the default namespace ``/`` is used.
        :param socketio_path: The endpoint where the Socket.IO server is
                              installed. The default value is appropriate for
                              most cases.
        :param wait_timeout: How long the client should wait for the
                             connection. The default is 5 seconds.

        Note: this method is a coroutine.
        zAlready connected©r   c                  óH   •— d‰ _         ‰ j                             ¦   «          d S )NT©r   r   Úset©r   s   €r   Úconnectz*AsyncSimpleClient.connect.<locals>.connectD   s%   ø€ à!ˆDŒNØÔ ×$Ò$Ñ&Ô&Ð&Ð&Ð&r   c                  ó:   •— ‰ j                              ¦   «          d S ©N)r   Úclearr!   s   €r   Ú
disconnectz-AsyncSimpleClient.connect.<locals>.disconnectI   s   ø€ àÔ ×&Ò&Ñ(Ô(Ð(Ð(Ð(r   c                  óH   •— d‰ _         ‰ j                             ¦   «          d S )NFr   r!   s   €r   Ú__disconnect_finalz5AsyncSimpleClient.connect.<locals>.__disconnect_finalM   s%   ø€ à"ˆDŒNØÔ ×$Ò$Ñ&Ô&Ð&Ð&Ð&r   Ú*c                 ót   •— ‰j                              | g|¢¦  «         ‰j                             ¦   «          d S r$   )r   Úappendr   r    )Úeventr   r   s     €r   Úon_eventz+AsyncSimpleClient.connect.<locals>.on_eventR   s;   ø€ àÔ×$Ò$ e ^¨d ^Ñ4Ô4Ð4ØÔ× Ò Ñ"Ô"Ð"Ð"Ð"r   )ÚheadersÚauthÚ
transportsÚ
namespacesÚsocketio_pathÚwait_timeoutN)r   ÚRuntimeErrorr   r   r   r%   Úclient_classr   r   r   r,   Úonr"   )r   Úurlr.   r/   r0   r   r2   r3   r"   r&   Ú$_AsyncSimpleClient__disconnect_finalr-   s   `           r   r"   zAsyncSimpleClient.connect   sµ  øè è € ðB Œ>ð 	4ÝÐ2Ñ3Ô3Ð3Ø"ˆŒØˆÔØÔ×ÒÑ Ô Ð Ø'�dÔ'ØÔð5Ø!%Ô!3ð5ð 5ˆŒð 
Œ×	Ò	 T¤^Ð	Ñ	4Ô	4ð	'ð 	'ð 	'ð 	'ñ 
5Ô	4ð	'ð 
Œ×	Ò	 T¤^Ð	Ñ	4Ô	4ð	)ð 	)ð 	)ð 	)ñ 
5Ô	4ð	)ð 
Œ×	Ò	 T¤^Ð	Ñ	4Ô	4ð	'ð 	'ð 	'ð 	'ñ 
5Ô	4ð	'ð 
Œ�Š˜ t¤~ˆÑ	6Ô	6ð	#ð 	#ð 	#ð 	#ñ 
7Ô	6ð	#ð Œk×!Ò!Ø˜ t¸
Ø!�{°-Ø%ð "ñ 'ô 'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'ð 	'r   c                 óR   — | j         r| j                              | j        ¦  «        ndS )zÆThe session ID received from the server.

        The session ID is not guaranteed to remain constant throughout the life
        of the connection, as reconnections can cause it to change.
        N)r   Úget_sidr   r!   s    r   ÚsidzAsyncSimpleClient.sid\   s(   € ð 7;´kÐKˆtŒ{×"Ò" 4¤>Ñ2Ô2Ð2ÀtÐKr   c                 óF   — | j         r| j                              ¦   «         ndS )zœThe name of the transport currently in use.

        The transport is returned as a string and can be one of ``polling``
        and ``websocket``.
        Ú )r   Ú	transportr!   s    r   r>   zAsyncSimpleClient.transporte   s$   € ð +/¬+Ð=ˆtŒ{×$Ò$Ñ&Ô&Ð&¸2Ð=r   c              ƒ   óä   K  — 	 | j                              ¦   «         ƒ d{V —† | j        st          ¦   «         ‚	 | j                             ||| j        ¬¦  «        ƒ d{V —†S # t          $ r Y nw xY wŒn)a?  Emit an event to the server.

        :param event: The event name. It can be any string. The event names
                      ``'connect'``, ``'message'`` and ``'disconnect'`` are
                      reserved and should not be used.
        :param data: The data to send to the server. Data can be of
                     type ``str``, ``bytes``, ``list`` or ``dict``. To send
                     multiple arguments, use a tuple where each element is of
                     one of the types indicated above.

        Note: this method is a coroutine.

        This method schedules the event to be sent out and returns, without
        actually waiting for its delivery. In cases where the client needs to
        ensure that the event was received, :func:`socketio.SimpleClient.call`
        should be used instead.
        TNr   )r   Úwaitr   r   r   Úemitr   r   )r   r,   Údatas      r   rA   zAsyncSimpleClient.emitn   sÁ   è è € ð$	ØÔ&×+Ò+Ñ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-Ø”>ð *Ý'Ñ)Ô)Ð)ðØ!œ[×-Ò-¨e°TØ8<¼ð .ñ Hô Hð Hð Hð Hð Hð Hð Hð Høå ð ð ð Ø�ðøøøð	s   ¹'A! Á!
A.Á-A.é<   c              ƒ   óú   K  — 	 | j                              ¦   «         ƒ d{V —† | j        st          ¦   «         ‚	 | j                             ||| j        |¬¦  «        ƒ d{V —†S # t          $ r ‚ t          $ r Y nw xY wŒy)aó  Emit an event to the server and wait for a response.

        This method issues an emit and waits for the server to provide a
        response or acknowledgement. If the response does not arrive before the
        timeout, then a ``TimeoutError`` exception is raised.

        :param event: The event name. It can be any string. The event names
                      ``'connect'``, ``'message'`` and ``'disconnect'`` are
                      reserved and should not be used.
        :param data: The data to send to the server. Data can be of
                     type ``str``, ``bytes``, ``list`` or ``dict``. To send
                     multiple arguments, use a tuple where each element is of
                     one of the types indicated above.
        :param timeout: The waiting timeout. If the timeout is reached before
                        the server acknowledges the event, then a
                        ``TimeoutError`` exception is raised.

        Note: this method is a coroutine.
        TN)r   Útimeout)	r   r@   r   r   r   Úcallr   r   r   )r   r,   rB   rE   s       r   rF   zAsyncSimpleClient.callŠ   sÒ   è è € ð(	ØÔ&×+Ò+Ñ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-Ð-Ø”>ð *Ý'Ñ)Ô)Ð)ðØ!œ[×-Ò-¨e°TØ8<¼Ø6=ð .ñ ?ô ?ð ?ð ?ð ?ð ?ð ?ð ?ð ?øõ  ð ð ð ØÝ ð ð ð Ø�ðøøøð	s   ¹(A" Á"A9Á8A9c              ƒ   ó
  K  — | j         sá	 t          j        | j                             ¦   «         |¬¦  «        ƒ d{V —† n!# t          j        $ r t          ¦   «         ‚w xY w| j        st          ¦   «         ‚	 t          j        | j                             ¦   «         |¬¦  «        ƒ d{V —† n!# t          j        $ r t          ¦   «         ‚w xY w| j         	                    ¦   «          | j         ¯á| j          
                    d¦  «        S )aã  Wait for an event from the server.

        :param timeout: The waiting timeout. If the timeout is reached before
                        the server acknowledges the event, then a
                        ``TimeoutError`` exception is raised.

        Note: this method is a coroutine.

        The return value is a list with the event name as the first element. If
        the server included arguments with the event, they are returned as
        additional list elements.
        )rE   Nr   )r   r   Úwait_forr   r@   r   r   r   r   r%   Úpop)r   rE   s     r   ÚreceivezAsyncSimpleClient.receive«   s`  è è € ð Ô#ð 	%ð%ÝÔ& tÔ';×'@Ò'@Ñ'BÔ'BØ/6ð8ñ 8ô 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8øåÔ'ð %ð %ð %Ý"‘n”nÐ$ð%øøøà”>ð *Ý'Ñ)Ô)Ð)ð%ÝÔ& tÔ'7×'<Ò'<Ñ'>Ô'>Ø/6ð8ñ 8ô 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð 8øåÔ'ð %ð %ð %Ý"‘n”nÐ$ð%øøøàÔ×"Ò"Ñ$Ô$Ð$ð Ô#ð 	%ð Ô ×$Ò$ QÑ'Ô'Ð's   ‹3? ¿AÁ63B* Â*Cc              ƒ   óv   K  — | j         r/| j                             ¦   «         ƒ d{V —† d| _        d| _         dS dS )zODisconnect from the server.

        Note: this method is a coroutine.
        NF)r   r   r&   r!   s    r   r&   zAsyncSimpleClient.disconnectÈ   sT   è è € ð
 Œ>ð 	#Ø”+×(Ò(Ñ*Ô*Ð*Ð*Ð*Ð*Ð*Ð*Ð*ØˆDŒKØ"ˆDŒNˆNˆNð	#ð 	#r   c              ƒ   ó
   K  — | S r$   © r!   s    r   Ú
__aenter__zAsyncSimpleClient.__aenter__Ò   s   è è € Øˆr   c              ƒ   ó>   K  — |                       ¦   «         ƒ d {V —† d S r$   )r&   )r   Úexc_typeÚexc_valÚexc_tbs       r   Ú	__aexit__zAsyncSimpleClient.__aexit__Õ   s.   è è € Ø�oŠoÑÔÐÐÐÐÐÐÐÐÐr   r$   )NrC   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r5   r   r"   Úpropertyr;   r>   rA   rF   rJ   r&   rN   rS   rM   r   r   r   r      sý   € € € € € ðð ð €Lðð ð ð *,°$À4Ø #°;Ø#$ð?'ð ?'ð ?'ð ?'ðB ðLð Lñ „XðLð ð>ð >ñ „Xð>ðð ð ð ð8ð ð ð ðB(ð (ð (ð (ð:#ð #ð #ðð ð ð ð  ð  ð  ð  r   r   )r   Úsocketior   Úsocketio.exceptionsr   r   r   r   rM   r   r   ú<module>r[      sz   ðØ €€€Ø  Ð  Ð  Ð  Ð  Ð  Ø NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NÐ NðP ð P ð P ð P ð P ñ P ô P ð P ð P ð P r   