
    <|hg                     (   d Z ddlmZ ddlmZ ddlmZ ddlmZ dxZ	xZ
xZxZZ G d de      Zd	 Z ee e       d
d       ddlmZ  ee e       ej                         	 ej(                  ZedfdddZee_        y# e$ r
  e       ZY w xY w)a  Cooperative low-level networking interface.

This module provides socket operations and some related functions.
The API of the functions and classes matches the API of the corresponding
items in the standard :mod:`socket` module exactly, but the synchronous functions
in this module only block the current greenlet and let the others run.

For convenience, exceptions (like :class:`error <socket.error>` and :class:`timeout <socket.timeout>`)
as well as the constants from the :mod:`socket` module are imported into this module.
    )PY311)	exc_clear)copy_globals)_socket3 c                       e Zd ZdZy)errorN)__name__
__module____qualname__errnor       L/var/www/html/test/engine/venv/lib/python3.12/site-packages/gevent/socket.pyr	   r	      s    Er   r	   c                      t               )N)NotImplementedError)argss    r   getfqdnr   #   s    

r   )__implements____dns____all____extensions____imports__
__socket__F)dunder_names_to_keepcleanup_globs)_socketcommon)
only_namesN)
all_errorsc                l   t         sd}| \  }}g }t        t        ||dt                    }|st	        d      |D ]b  }|\  }	}
}}}d}	 t        |	|
|      }|t        ur|j                  |       |r|j                  |       |j                  |       |dd= 	 |d}c S  y# d}w xY w# t        $ rf}|s|g}n|j                  |       ~||j                          d}||d   u r|s|dd=  	 t        d|      # |dd= w xY wt                Y d}~d}~wt        $ r ||j                          d} w xY w)a  
    create_connection(address, timeout=None, source_address=None, *, all_errors=False) -> socket

    Connect to *address* and return the :class:`gevent.socket.socket`
    object.

    Convenience function. Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object. Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect. If no *timeout* is supplied, the
    global default timeout setting returned by
    :func:`getdefaulttimeout` is used. If *source_address* is set it
    must be a tuple of (host, port) for the socket to bind as a source
    address before making the connection. A host of '' or port 0 tells
    the OS to use the default.

    .. versionchanged:: 20.6.0
        If the host part of the address includes an IPv6 scope ID,
        it will be used instead of ignored, if the platform supplies
        :func:`socket.inet_pton`.
    .. versionchanged:: 22.08.0
        Add the *all_errors* argument. This only has meaning on Python 3.11+;
        it is a programming error to pass it on earlier versions.
    .. versionchanged:: 23.7.0
        You can pass a value for ``all_errors`` on any version of Python.
        It is forced to false for any version before 3.11 inside the function.
    Fr   z!getaddrinfo returns an empty listNzcreate_connection failed)r   listgetaddrinfoSOCK_STREAMr	   socket_GLOBAL_DEFAULT_TIMEOUT
settimeoutbindconnectappendcloseExceptionGroupr   BaseException)addresstimeoutsource_addressr   hostport
exceptionsaddrsresafsocktypeproto
_canonnamesasockexcs                   r   create_connectionr<   >   sn   B 
JD$J T4K89E788 6.1+HeZ3	"h.D55(		.)LLR 1m6l W  	!U
!!#&

DeBi!"1& ))CZPP #1 KK 	 

D	s7   A
B'B  B$'	D30;D,C88C??D"D3)__doc__gevent._compatr   r   gevent._utilr   geventr   _sourcer   r   r   r   r   	Exceptionr	   r   globalsr   r   r%   AttributeErrorobjectr<   r   r   r   <module>rF      s   	 ! $ % '
 EG F F F7 F^kI   Wgi#R " ! ]GI%446'(@@
 (?t b!&bP . Y  '$h's   %B BB