�
���g�l � � � d dl Z d dlZd dlZd dlZddlmZ ddlmZ ddlmZ ej d� � Z G d� dej
� � ZdS ) � N� )�base_client)�
exceptions)�packetzsocketio.clientc � � e Zd ZdZd� Zi dddddddfd�Zd � Zd d
�Zd!d�Zd"d
�Z d� Z
d� Zd� Zd#d�Z
d� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� ZdS )$�AsyncClientar
A Socket.IO client for asyncio.
This class implements a fully compliant Socket.IO web client with support
for websocket and long-polling transports.
:param reconnection: ``True`` if the client should automatically attempt to
reconnect to the server after an interruption, or
``False`` to not reconnect. The default is ``True``.
:param reconnection_attempts: How many reconnection attempts to issue
before giving up, or 0 for infinite attempts.
The default is 0.
:param reconnection_delay: How long to wait in seconds before the first
reconnection attempt. Each successive attempt
doubles this delay.
:param reconnection_delay_max: The maximum delay between reconnection
attempts.
:param randomization_factor: Randomization amount for each delay between
reconnection attempts. The default is 0.5,
which means that each delay is randomly
adjusted by +/- 50%.
:param logger: To enable logging set to ``True`` or pass a logger object to
use. To disable logging set to ``False``. The default is
``False``. Note that fatal errors are logged even when
``logger`` is ``False``.
:param json: An alternative json module to use for encoding and decoding
packets. Custom json modules must have ``dumps`` and ``loads``
functions that are compatible with the standard library
versions.
:param handle_sigint: Set to ``True`` to automatically handle disconnection
when the process is interrupted, or to ``False`` to
leave interrupt handling to the calling application.
Interrupt handling can only be enabled when the
client instance is created in the main thread.
The Engine.IO configuration supports the following settings:
:param request_timeout: A timeout in seconds for requests. The default is
5 seconds.
:param http_session: an initialized ``aiohttp.ClientSession`` object to be
used when sending requests to the server. Use it if
you need to add special client options such as proxy
servers, SSL certificates, custom CA bundle, etc.
:param ssl_verify: ``True`` to verify SSL certificates, or ``False`` to
skip SSL certificate verification, allowing
connections to servers with self signed certificates.
The default is ``True``.
:param websocket_extra_options: Dictionary containing additional keyword
arguments passed to
``websocket.create_connection()``.
:param engineio_logger: To enable Engine.IO logging set to ``True`` or pass
a logger object to use. To disable logging set to
``False``. The default is ``False``. Note that
fatal errors are logged even when
``engineio_logger`` is ``False``.
c � � dS )NT� ��selfs �e/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/socketio/async_client.py�is_asyncio_basedzAsyncClient.is_asyncio_basedF s � ��t� Nz socket.ioTr Fc
� �� K � | j rt j d� � �|| _ || _ || _ || _ || _ || _ |��t t | j � � � � � �
t | j � � � � � � � � � }d|v r|� d� � t! |� � dk rdg}nt# |t$ � � r|g}|| _ i | _ | j �| j � � � | _ n| j � � � | � | j � � � d{V ��}
| � | j � � � d{V ��} | j � |
|||�� � � d{V �� n�# t4 j j $ r�}| j D ]O}
| � d|
t! |j � � dk r
|j d n|j d � � � d{V �� �P| r0| � � � � d{V �� | j j d k rY d}~dS t j |j d � � |�d}~ww xY w|r� t? j | j �! � � |� � � d{V �� | j � � � t | j � � t | j � � k rn�wn# t>