%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.12/__pycache__/socket.cpython-312.pyc

�

���f#����dZddlZddl�ddlZddlZddlZddlZddlmZmZ	ddl	Z	ee	dd�Zee	dd�Z
ee	d	d�Zgd
�Zej!ej"e��ej$ded��ej$d
ed��ej$ded��ej$ded��dZdZd�Zej.j1�j3d��r�iZded<ded<ded<ded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<ej7dӫGdԄd�e�ZGdքd�ej<�Zd�d؄Ze ej<d٫rddl!Z!d�dڄZ"ej7d۫e ej<dܫrddl!Z!d�d݄Z#ej7dޫe ej<d߫rd�Z$ej7d�e ed�rde%dfd�Z&ne'e%dfd�Z&ej7d�d�e&_e
ehZ(Gd�d�ejR�Z*d�d�Z+e,�Z-e-dfd�d�d�Z.d�Z/e'dd�d�d�d�Z0d�d�Z1y#e
$rdZ	Y���wxYw)�a�This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
send_fds() -- Send file descriptor to the socket.
recv_fds() -- Receive file descriptors from the socket.
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.
create_server() -- create a TCP socket and bind it to a specified address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK)�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindrc�H�|j�xr|jd�S)N�AF_��isupper�
startswith��Cs �/usr/lib/python3.12/socket.py�<lambda>rO���!�)�)�+�5�!�,�,�u�"5��rc�H�|j�xr|jd�S)N�SOCK_rrs rrrTs��!�)�)�+�7�!�,�,�w�"7�r�MsgFlagc�H�|j�xr|jd�S)N�MSG_rrs rrrYs��!�)�)�+�6�!�,�,�v�"6�r�AddressInfoc�H�|j�xr|jd�S)N�AI_rrs rrr^rrz	127.0.0.1z::1c�6�	||�S#t$r|cYSwxYw)z{Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    )�
ValueError)�value�
enum_klasss  r�_intenum_converterr)ds&��
��%� � �������s�
���winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z!The socket operation would block.i3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc��eZdZy)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__�rrr0r0�s�rr0c�H��eZdZdZgd�Zd d�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd!dddd�d�Ze
ed
�rd"d�Znd"d�Zd"d�Zd�Zd"d�Zd�Zej*fd�Zd�Z�fd�Ze�fd��Ze�fd��Zej8dk(rd�Zd�Znd�Zd�Zde_de_�xZS)#�socketz:A subclass of _socket.socket adding the makefile() method.)�__weakref__�_io_refs�_closedNc��|�|dk(rt}|dk(rt}|dk(rd}tjj	|||||�d|_d|_y)N���rF)�AF_INET�SOCK_STREAM�_socketr6�__init__r8r9)�self�family�type�proto�filenos     rr?zsocket.__init__�sU��
�>���|� ���r�z�"����{���������f�d�E�6�B���
���rc��|S�Nr4�r@s r�	__enter__zsocket.__enter__�s���rc�>�|js|j�yyrF)r9�close)r@�argss  r�__exit__zsocket.__exit__�s���|�|��J�J�L�rc���t|dd�}d|jj|jj|rdnd|j	�|j
|j|jfz}|sH	|j�}|r|dt|�zz
}	|j�}|r|dt|�zz
}|dz
}|S#ttf$rY�<wxYw#ttf$rY�-wxYw)	zVWrap __repr__() to reveal the real class name and socket
        address(es).
        r9Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)
�getattr�	__class__r2r3rDrArBrC�getsockname�str�error�AttributeError�getpeername)r@�closed�s�laddr�raddrs     r�__repr__zsocket.__repr__�s�����y�%�0��:��~�~�(�(��~�~�*�*�$�{�"��{�{�}��{�{��y�y��z�z�
�
���
��(�(�*������E�
�2�2�A�
��(�(�*������E�
�2�2�A�	
�S�������>�*�
��
���>�*�
��
�s$�5#C�#C�C�C�C*�)C*c�H�td|jj�d���)Nzcannot pickle z object)�	TypeErrorrQr1rGs r�__getstate__zsocket.__getstate__s!���.����)@�)@�(C�7�K�L�Lrc���t|j��}|j|j|j|j
|��}|j
|j��|S)z�dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        �rD)�duprDrQrArBrC�
settimeout�
gettimeout)r@�fd�socks   rraz
socket.dupsN�������
���~�~�d�k�k�4�9�9�d�j�j��~�L��������)�*��rc���|j�\}}t|j|j|j|��}t��!|j
�r|jd�||fS)z�accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        r`T)�_acceptr6rArBrC�getdefaulttimeoutrc�setblocking)r@rd�addrres    r�acceptz
socket.accept s[���<�<�>���D��d�k�k�4�9�9�d�j�j��D����&�4�?�?�+<����T�"��T�z�r)�encoding�errors�newlinec�<�t|�hd�kstd|�d���d|v}d|vxs|}|s|sJ�d|v}d}	|r|	dz
}	|r|	dz
}	t||	�}
|xjdz
c_|�d	}|d
krtj
}|d
k(r|std��|
S|r|rt	j|
|
|�}n3|rt	j|
|�}n|sJ�t	j|
|�}|r|St	j|�}t	j||||�}||_|S)z�makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        >�b�r�wz
invalid mode z (only r, w, b allowed)rrrqrprN�r;rz!unbuffered streams must be binary)�setr&�SocketIOr8�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
text_encoding�
TextIOWrapper�mode)
r@r}�	bufferingrlrmrn�writing�reading�binary�rawmode�raw�buffer�texts
             r�makefilezsocket.makefile0s;���4�y�O�+���O�P�P���+����+�,�W����'�!�!���������s�N�G���s�N�G��t�W�%���
�
���
����I��q�=��.�.�I���>�� �!D�E�E��J��w��&�&�s�C��;�F�
��&�&�s�I�6�F��N�7��&�&�s�I�6�F���M��#�#�H�-�������&�'�B����	��r�sendfilec�0�|j|||�|j�}	|j�}	t
j|�j}|syt|xs|d�}|j�}	|	dk(rtd��ttd�rtj�}
ntj �}
|
j#|tj$�d}|
j&}tj(}
		|	r||	�st+d��|rt||z
|�}|dkrn	|
||||�}|dk(rn||z
}||z
}�I||dkDrt|d�r|j/|�SSS#ttjf$r}t|��d}~wwxYw#t$r}t|��d}~wwxYw#t,$r|	s|�Y��t$r}|dk(rt|��|d�d}~wwxYw#|dkDrt|d�r|j/|�wwwxYw)Nri@�&non-blocking sockets are not supported�PollSelectorz	timed out�seek)�_check_sendfile_paramsrDrUrv�UnsupportedOperationr0�os�fstat�st_size�OSError�minrcr&�hasattr�	selectorsr��SelectSelector�register�EVENT_WRITE�selectr��TimeoutError�BlockingIOErrorr�)r@�file�offset�count�socknorD�err�fsize�	blocksize�timeout�selector�
total_sent�selector_select�os_sendfile�sents               r�_sendfile_use_sendfilezsocket._sendfile_use_sendfile]s���'�'��f�e�<��[�[�]�F�
-������
-�����(�0�0�����E�N�U�G�4�I��o�o�'�G��!�|� �!I�J�J��y�.�1�$�1�1�3��$�3�3�5�����f�i�&;�&;�<��J�&�o�o�O��+�+�K� 
&����w�'?�*�;�7�7��$'��
�(:�I�$F�	�$��>�!�+�*�6�6�6�9�M��  �1�9�!��$���"�d�*�
�7�8"���>�g�d�F�&;��I�I�f�%�'<�>��s#�B�$;�$;�<�
-�'��,�,��
-���
-�'��,�,��
-��@+�!�&�,�-� �"�,�%��?�
#4�C�"8�8�!�t�+��,����>�g�d�F�&;��I�I�f�%�'<�>�sj�E0�F�-G/�.F8�9G/�0F�	F�F�	F5�%F0�0F5�8G,�
G/�G,�G'�'G,�,G/�/&Hc��td��)Nz,os.sendfile() not available on this platform)r0�r@r�r�r�s    rr�zsocket._sendfile_use_sendfile�s��#�>�@�
@rc�L�|j|||�|j�dk(rtd��|r|j|�|rt	|d�nd}d}|j
}|j}		|rt	||z
|�}|dkrn:t||��}|sn&		||�}	||	z
}|	t|�kr||	d}nn�$�Q||dkDr"t|d�r|j||z�SSS#t$rY�ZwxYw#|dkDr"t|d�r|j||z�wwwxYw)Nrr�i r�)r�rcr&r�r��read�send�
memoryview�lenr�r�)
r@r�r�r�r�r��	file_read�	sock_send�datar�s
          r�_sendfile_use_sendzsocket._sendfile_use_send�sM���#�#�D�&�%�8��?�?���!��E�F�F���I�I�f��(-�C��t�$�4�	��
��I�I�	��I�I�	�	/��� #�E�J�$6�	� B�I� �A�~��!�)�I�"6�7�����	"�(����#�d�*�
��#�d�)�+�#'���;�D�!���&��A�~�'�$��"7��	�	�&�:�-�.�#8�~��+�!� �!���A�~�'�$��"7��	�	�&�:�-�.�#8�~�s0�0-C:�C+�&C:�+	C7�4C:�6C7�7C:�:)D#c��dt|dd�vrtd��|jtzstd��|�Jt	|t
�st
dj|���|dkrtdj|���yy)Nrpr}z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)rPr&rBr=�
isinstance�intr]�formatr�s    rr�zsocket._check_sendfile_params�s����g�d�F�C�0�0��C�D�D��y�y�;�&��J�K�K����e�S�)��A�H�H��O�Q�Q���z� �A�H�H��O�Q�Q��	rc�n�	|j|||�S#t$r|j|||�cYSwxYw)a_sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        )r�r0r�r�s    rr�zsocket.sendfile�sC��$	@��.�.�t�V�U�C�C�� �	@��*�*�4���?�?�	@�s��4�4c��|jdkDr|xjdzc_|jr|j�yy)Nrrs)r8r9rJrGs r�_decref_socketioszsocket._decref_socketios�s1���=�=�1���M�M�Q��M��<�<��J�J�L�rc�&�|j|�yrF)rJ)r@�_sss  r�_real_closezsocket._real_close�s
���	�	�$�rc�R�d|_|jdkr|j�yy)NTr)r9r8r�rGs rrJzsocket.close�s&������=�=�A������rc�.��d|_t�|�	�S)adetach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        T)r9�super�detach�r@rQs �rr�z
socket.detach�s�������w�~��rc�4��tt�|�t�S)z@Read-only access to the address family for this socket.
        )r)r�rArr�s �rrAz
socket.familys���"�%�'�.�-�@�@rc�4��tt�|�t�S)z-Read-only access to the socket type.
        )r)r�rBrr�s �rrBzsocket.type
s���"�%�'�,�
�;�;r�ntc�H�tj|j��SrF)r��get_handle_inheritablerDrGs r�get_inheritablezsocket.get_inheritables���,�,�T�[�[�]�;�;rc�L�tj|j�|�yrF)r��set_handle_inheritablerD�r@�inheritables  r�set_inheritablezsocket.set_inheritables���%�%�d�k�k�m�[�Arc�H�tj|j��SrF)r�r�rDrGs rr�zsocket.get_inheritables���%�%�d�k�k�m�4�4rc�L�tj|j�|�yrF)r�r�rDr�s  rr�zsocket.set_inheritables�����t�{�{�}�k�:rz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r;r;r;N)rqN�rN) r1r2r3�__doc__�	__slots__r?rHrLr[r^rarkr�r�r�r�r�r�r�r�r>r6r�rJr��propertyrArB�namer�r��
__classcell__�rQs@rr6r6�s����D�6�I�� ���<M�	�� )��t�T�)�V�r�:��?	&�B	@�"/�HQ�@�.�&�n�n��� ��A��A�
�<��<�

�w�w�$��	<�	B�	5�	;�F�O��F�O��rr6c�4�t|�}t||||�S)z� fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    )rar6)rdrArBrC�nfds     rrrs���b�'�C��&�$��s�+�+r�sendmsgc	��|j|tjtjt	jd|�fg�S)z� send_fds(sock, buffers, fds[, flags[, address]]) -> integer

        Send the list of file descriptors fds over an AF_UNIX socket.
        �i)r�r>�
SOL_SOCKET�
SCM_RIGHTS�array)re�buffers�fds�flags�addresss     r�send_fdsr�)s?��
�|�|�G�w�'9�'9�������C�� 5�'7�&8�9�	9rr��recvmsgc	��tjd�}|j|tj||jz��\}}}}|D]d\}}	}
|tj
k(s�|	tjk(s�/|j|
dt|
�t|
�|jzz
��f|t|�||fS)z� recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file
        descriptors, msg_flags, address)

        Receive up to maxfds file descriptors returning the message
        data and a list containing the descriptors.
        r�N)
r�r�r>�CMSG_LEN�itemsizer�r��	frombytesr��list)re�bufsize�maxfdsr�r��msg�ancdatarj�
cmsg_level�	cmsg_type�	cmsg_datas           r�recv_fdsr�5s����k�k�#���$(�L�L�����V�c�l�l�2�3�%5�!��W�e�T�07�	K�,�J�	�9��g�0�0�0�Y�'�BT�BT�5T��
�
�i�)I��I��#�i�.�3�<�<�*G�H�J�K�	K�
�D��I�u�d�*�*rr��sharec��tddd|�S)z� fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        r)r6)�infos r�	fromsharer�Is���a��A�t�$�$rr��
socketpairc���|�	t}tj|||�\}}t||||j
��}t||||j
��}||fS#t$r	t}Y�gwxYw)aasocketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        )�AF_UNIX�	NameErrorr<r>r�r6r�)rArBrC�arps     rr�r�Tsx���>�
!� ���!�!�&�$��6���1��6�4�����
�3���6�4�����
�3���!�t����
!� ��
!�s�A � A2�1A2c��|tk(rt}n|tk(rt}nt	d��|t
k7rt	d��|dk7rt	d��t
|||�}	|j|df�|j�|j�dd\}}t
|||�}	|jd�	|j||f�|jd�|j�\}}		|j�||fS#ttf$rY�JwxYw#|j��xYw#|j�wxYw)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r<�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6r&r=r6�bind�listenrRri�connectr��InterruptedErrorrkrJ)
rArBrC�host�lsockrj�port�csock�ssock�_s
          rr�r�is<���W���D�
�x�
� �D��-�.�
.��;���H�I�I��A�:��>�?�?��v�t�U�+��	��J�J��a�y�!��L�L�N��*�*�,�R�a�0�J�D�$��6�4��/�E�

��!�!�%�(���M�M�4��,�/��!�!�$�'� �<�<�>���q�

�K�K�M��u�~���(�)9�:�����
����
����K�K�M�sC�AD.�%D�7D�
$D�D�D�D�D�D+�+D.�.Ea8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
c�l��eZdZdZd�Zd�Zd�Zd�Zd�Z�fd�Z	d�Z
ed	��Zed
��Z
d�Z�xZS)ruz�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    c���|dvrtd|z��tjj|�||_d|vr|dz
}||_d|v|_d|v|_d|_y)N)rqrr�rw�rb�wb�rwbzinvalid mode: %rrprqrrF)	r&rv�	RawIOBaser?�_sock�_mode�_reading�_writing�_timeout_occurred)r@rer}s   rr?zSocketIO.__init__�sj���:�:��/�$�6�7�7�
�����d�#���
��d�?��C�K�D���
��t���
��t���
�!&��rc��|j�|j�|jrtd��		|jj|�S#t$r	d|_�t$r}|jtvrYd}~y�d}~wwxYw)a3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        z!cannot read from timed out objectTN)
�_checkClosed�_checkReadablerr�r�	recv_intor�rT�errno�_blocking_errnos�r@rp�es   r�readintozSocketIO.readinto�s���	
���������!�!��=�>�>��
��z�z�+�+�A�.�.���
�)-��&���
��7�7�.�.����
�s�A�B�.B�B�Bc���|j�|j�	|jj|�S#t$r}|j
tvrYd}~y�d}~wwxYw)aWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        N)r�_checkWritablerr�rTrrrs   r�writezSocketIO.write�sW��	
��������	��:�:�?�?�1�%�%���	��w�w�*�*����		�s�=�	A#�A�A�A#c�H�|jrtd��|jS)z2True if the SocketIO is open for reading.
        �I/O operation on closed socket.)rWr&rrGs r�readablezSocketIO.readable��!���;�;��>�?�?��}�}�rc�H�|jrtd��|jS)z2True if the SocketIO is open for writing.
        r#)rWr&rrGs r�writablezSocketIO.writable�r%rc�N��|jrtd��t�|�
�S)z2True if the SocketIO is open for seeking.
        r#)rWr&r��seekabler�s �rr)zSocketIO.seekable�s&����;�;��>�?�?��w��!�!rc�V�|j�|jj�S)z=Return the file descriptor of the underlying socket.
        )rrrDrGs rrDzSocketIO.fileno�s#��	
�����z�z� � �"�"rc�<�|js|j�Sy)Nr;)rWrDrGs rr�z
SocketIO.name�s���{�{��;�;�=� �rc��|jSrF)rrGs rr}z
SocketIO.mode�s���z�z�rc��|jrytjj|�|jj�d|_y)z�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N)rWrvrrJrr�rGs rrJzSocketIO.closes7���;�;��
�����4� ��
�
�$�$�&���
r)r1r2r3r�r?rr!r$r'r)rDr�r�r}rJr�r�s@rruru�sX����
'��.� ��"�#���������rruc���|j�}|r|dvr
t�}	t|�\}}}|jd|�|D]	}d|vs�|S|}|S#t$rY|SwxYw)azGet fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available and `name`
    was given, it is returned unchanged. If `name` was empty, '0.0.0.0' or '::',
    hostname from gethostname() is returned.
    )z0.0.0.0z::r�.)�strip�gethostname�
gethostbyaddr�insertrT)r��hostname�aliases�ipaddrss    rrr
s����:�:�<�D��4�,�,��}��
�%2�4�%8�"��'�7�	���q�(�#��	�D��d�{���K�	��D��K���
���K�
�s�A�	A"�!A"F)�
all_errorsc�"�|\}}g}t||dt�D]j}|\}}	}
}}d}
	t||	|
�}
|tur|
j	|�|r|
j|�|
j
|�|j�|
cSt|�r	|s|d�td|��td��#t$r?}|s|j�|j|�|
�|
j�Yd}~��d}~wwxYw#|j�wxYw)a�Connect to *address* and return the 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. When a connection
    cannot be created, raises the last error if *all_errors* is False,
    and an ExceptionGroup of all errors if *all_errors* is True.
    rNzcreate_connection failedz!getaddrinfo returns an empty list)
�getaddrinfor=r6�_GLOBAL_DEFAULT_TIMEOUTrbrr�clearrT�appendrJr��ExceptionGroup)r�r��source_addressr7rr�
exceptions�res�af�socktyperC�	canonname�sare�excs               rr
r
*s�� �J�D�$��J��4��q�+�6���-0�*��H�e�Y����	��"�h��.�D��5�5�����(���	�	�.�)��L�L��������K��*�:��	�� ��m�#� �!;�Z�H�H�
�7�8�8��!�	��� � �"����c�"����
�
����	��
����s$�AB1�C<�1	C9�:5C4�4C9�<Dc��tr ttd�rttd�sy	ttt
�5}|j
ttd�	ddd�y#1swYyxYw#t$rYywxYw)z�Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    �IPPROTO_IPV6�IPV6_V6ONLYFrNT)
�has_ipv6r�r>r6r�r=�
setsockoptrGrHrT)res rrr]sj����7�N�3��7�M�2���
�H�k�
*�	�d��O�O�L�+�q�9��	�	�	������s.�A/�A#�A/�#A,�(A/�,A/�/	A;�:A;)rA�backlog�
reuse_port�dualstack_ipv6c�z�|rttd�std��|r)t�std��|tk7rtd��t|t�}	tjdvr,ttd�r	|jttd�|r|jttd�trb|tk(rY|r|jtt d�n;ttd	�r+ttd
�r|jtt d�	|j#|�|�|j)�|S|j)|�|S#t$rY��wxYw#t$r.}|j$�d|�d�}t|j&|�d
�d
}~wwxYw#t$r|j+��wxYw)a�Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    �SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrsrrHrGz& (while attempting to bind on address �)N)r�r>r&rr�r6r=r�r�rJr�rQrTrOrIrGrHr�strerrorrrrJ)r�rArKrLrMrer�r�s        rrrms{��&�'�'�>�:��F�G�G��!�#��L�M�M��X���F�G�G��&�+�&�D�'��7�7�*�*����0�
����
�L�!�<�
��O�O�J��a�8���(�*������k�1�=���-�0��G�^�4�����k�1�=�	2��I�I�g��
�?��K�K�M���
�K�K�� ����-�
��
���	2����w�(�C���	�	�3�'�T�1��	2�����
�
��
��s[�"F�=E�BF�E%�/F�F�	E"�F�!E"�"F�%	F�.)F�F�F�F:c��g}tj||||||�D]<}|\}}	}}
}|jt|t�t|	t
�||
|f��>|S)a�Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    )r>r9r<r)rr)rrrArBrCr��addrlistr@rArBrCrDs            rr9r9�sp�� �H��"�"�4��v�t�U�E�J�0��-0�*��H�e�Y�����+�B�
�>�+�H�j�A��	�2�/�	0�0�
�Or)rr�)rN)rrrr)2r�r>r��sysrvr��enumrrr�ImportErrorrPrrr
�__all__�extend�_get_exports_list�	_convert_r1r�r�r)�platform�lowerrr.r<�	Exceptionr0r6rr�r�r�r�r�r=r�r<rrrur�objectr:r
rrr9r4rr�<module>ras���.�`����!���	��w��"��	���"�	%���e�]�B�/��@�����#�r�#�#�G�,�-�������5�7�
������7�9�
������6�8�
������5�7�
�
��
���<�<����"�"�5�)��H�=�H�Q�K�2�H�Q�K�8�H�R�L�3�H�S�M�H�H�S�M�?�H�S�M�6�H�U�O�5�H�U�O�*�H�U�O�9�H�U�O�;�H�U�O�,�H�U�O�9�H�U�O�D�H�U�O�6�H�U�O�6�H�U�O�5�H�U�O�)�H�U�O�7�H�U�O�,�H�U�O�/�H�U�O�2�H�U�O�0�H�U�O�6�H�U�O�H�H�U�O�6�H�U�O�8�H�U�O�(�H�U�O�/�H�U�O�<�H�U�O�9�H�U�O�6�H�U�O�2�H�U�O�4�H�U�O�0�H�U�O�7�H�U�O�,�H�U�O�0�H�U�O�+�H�U�O�.�H�U�O�-�H�U�O�)�H�U�O�0�H�U�O�,�H�U�O�+�H�U�O�,�H�U�O�,�H�U�O�4�H�U�O�'�H�U�O�9�H�U�O�9�H�U�O�@�H�U�O�6�H�U�O�B�H�U�O�/�H�U�O�8�H�U�O�4�H�U�O�>�H�U�O�,�H�U�O�*�H�U�O�-�H�U�O�B�H�U�O�*�H�U�O�3�H�U�O�'�H�U�O�8�H�U�O�7�H�U�O�B�H�U�O�&�H�U�O�$�H�U�O�'�H�U�O�)�H�U�O�.�H�U�O�,�H�U�O�+�H�U�O�&�H�U�O�'�H�U�O�2�H�U�O�*�H�U�O�/�H�U�O�+�H�U�O�4�H�U�O�1�H�U�O�1�H�U�O�3�H�U�O�2�H�U�O�1�H�U�O�0�H�U�O�2�H�U�O�4�H�U�O�?�H�U�O�A�H�U�O�>�H�U�O�8�H�U�O�9�H�U�O��N�N�:��)�	�(�DG�W�^�^�DG�L
,��7�>�>�9�%��9��N�N�:��
�7�>�>�9�%��+�"�N�N�:��
�7�>�>�7�#�%��N�N�;��
�7�L�!��[���*"��1�#�H�N�N�<� ��
���[�*��r�r�|�|�r�j�6!�(��'>�%)�09�9>�09�f
� &-�d�u�!&�B�J��m���E��s�O0�0O;�:O;

Zerion Mini Shell 1.0