AlkantarClanX12

Your IP : 3.15.239.50


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/__pycache__/socket.cpython-39.opt-2.pyc

a

R�f3��@sTddlZddlTddlZddlZddlZddlZddlmZmZzddlZWne	ybdZYn0e
edd�Ze
edd�Ze
edd�Z
gd	�Ze�e�e��e�d
edd��e�d
edd��e�dedd��e�dedd��dZdZdd�Zej���d��riZded<ded<ded<ded<d ed!<d"ed#<d$ed%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d0ed1<d2ed3<d4ed5<d6ed7<d8ed9<d:ed;<d<ed=<d>ed?<d@edA<dBedC<dDedE<dFedG<dHedI<dJedK<dLedM<dNedO<dPedQ<dRedS<dTedU<dVedW<dXedY<dZed[<d\ed]<d^ed_<d`eda<dbedc<ddede<dfedg<dhedi<djedk<dledm<dnedo<dpedq<dreds<dtedu<dvedw<dxedy<dzed{<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�<d�ed�<d�ed�<d�ed�<e�dԡGd�dքd�e�ZGd�d؄d�ej�Zd�d�dڄZeejdۃ�rfddl Z d�d�d݄Z!e�dݡeejdރ�r�ddl Z d�d�d�Z"e�d�eejd��r�d�d�Z#e�d�e$e%dfd�d�Z&eed��r�de%dfd�d�Z'ne&Z'e�d�d�e'_(ee
hZ)Gd�d�d�ej*�Z+d�d�d�Z,e-�Z.e.dfd�d�Z/d�d�Z0e$dd�d�d�d�d��Z1d�d�d��Z2dS)��N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK)�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindrcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�+/opt/alt/python39/lib64/python3.9/socket.py�<lambda>N�rrcCs|��o|�d�S)NZSOCK_rrrrrrSrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrXrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr]rz	127.0.0.1z::1cCs&z
||�WSty |YS0dS�N)�
ValueError)�valueZ
enum_klassrrr�_intenum_convertercs
r�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 blocki3'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@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr#�rr#cs&eZdZgd�Zd6dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
d7dddd�dd�Zee
d�rtd8dd�Zn
d9dd�Zd:dd�Zdd�Zd;dd �Zd!d"�Zejfd#d$�Zd%d&�Z�fd'd(�Ze�fd)d*��Ze�fd+d,��Ze
jd-k�rd.d/�Zd0d1�Znd2d/�Zd3d1�Zd4e_d5e_�ZS)<�socket)�__weakref__�_io_refs�_closed���NcCsP|dur,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr+rF)�AF_INET�SOCK_STREAM�_socketr'�__init__r)r*)�self�family�type�proto�filenorrrr/�szsocket.__init__cCs|Srr�r0rrr�	__enter__�szsocket.__enter__cGs|js|��dSr)r*�close)r0�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
yrYn0z |��}|r�|dt	|�7}Wnt
y�Yn0|d7}|S)	Nr*Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r%r&r4r1r2r3�getsockname�str�error�getpeername)r0�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r$r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)N�r4)�dupr4r=r1r2r3�
settimeout�
gettimeout)r0�fd�sockrrrrHsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dur>|��r>|�d�||fS)NrGT)Z_acceptr'r1r2r3ZgetdefaulttimeoutrJ�setblocking)r0rK�addrrLrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�hd�kstd|f��d|v}d|vp2|}d|v}d}	|rL|	d7}	|rX|	d7}	t||	�}
|jd7_|dur|d}|d	kr�tj}|d	kr�|s�td
��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)N>rP�w�bz&invalid mode %r (only r, w, b allowed)rTrPrUr:�r+rz!unbuffered streams must be binary)�setr�SocketIOr)�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r0r_�	bufferingrQrRrSZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile.s<
zsocket.makefile�sendfilerc
Cs|�|||�|��}z|��}Wn2ttjfyT}zt|��WYd}~n
d}~00zt�|�j}Wn,t	y�}zt|��WYd}~n
d}~00|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
�z�|	�r||	��st�d��|�r6||}|dk�r6�q�z|
||||�}Wnbt�yn|	�sd|�Y�qYn\t	�y�}z$|dk�r�t|��|d�WYd}~n(d}~00|dk�r��q�||7}||7}�q|W|dk�r�t
|d��r�|�|�Sn"|dk�rt
|d��r|�|�0dS)Nri@�&non-blocking sockets are not supported�PollSelectorz	timed out�seek)�_check_sendfile_paramsr4�AttributeErrorrY�UnsupportedOperationr#�os�fstat�st_size�OSError�minrJr�hasattr�	selectorsrgZSelectSelector�registerZEVENT_WRITEZselectrer.�timeout�BlockingIOErrorrh)r0�file�offset�countZsocknor4�errZfsize�	blocksizertZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileZsh







��zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r#�r0rvrwrxrrrr}�s�c

Cs |�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnty�Yq�Yq�0||	7}|	t	|�kr�||	d�}q�qTq�qT|W|dkr�t
|d�r�|�||�Sn&|dk�rt
|d��r|�||�0dS)Nrrfi rh)rirJrrhrp�read�send�
memoryviewru�lenrq)
r0rvrwrxrzr{Z	file_readZ	sock_send�datar|rrr�_sendfile_use_send�sB

��zsocket._sendfile_use_sendcCsddt|dd�vrtd��|jt@s*td��|dur`t|t�sJtd�|���|dkr`td�|���dS)NrUr_z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr2r-�
isinstance�intrE�formatr~rrrri�s

��zsocket._check_sendfile_paramscCs6z|�|||�WSty0|�|||�YS0dSr)r}r#r�r~rrrre�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrV)r)r*r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr)r7)r0Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r*r)r�r5rrrr7�s
zsocket.closecsd|_t���S)NT)r*�super�detachr5�r=rrr��sz
socket.detachcstt�jt�Sr)rr�r1rr5r�rrr1sz
socket.familycstt�jt�Sr)rr�r2rr5r�rrr2szsocket.type�ntcCst�|���Sr)rlZget_handle_inheritabler4r5rrr�get_inheritableszsocket.get_inheritablecCst�|��|�dSr)rlZset_handle_inheritabler4�r0Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr)rlr�r4r5rrrr�scCst�|��|�dSr)rlr�r4r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r+r+r+N)rPN)rN)rN)rN)rN) r$r%r&�	__slots__r/r6r9rDrFrHrOrdrqrlr}r�rirer�r.r'r�r7r��propertyr1r2�namer�r��__doc__�
__classcell__rrr�rr'�s@
�*
A

$


r'cCst|�}t||||�Sr)rHr')rKr1r2r3Znfdrrrr
sr
�sendmsgc	Cs |�|tjtjt�d|�fg�S�N�i)r�r.�
SOL_SOCKET�
SCM_RIGHTS�array)rLZbuffers�fds�flags�addressrrr�send_fds&s
�r��recvmsgcCs�t�d�}|�|t�||j��\}}}}|D]B\}}	}
|tjkr.|	tjkr.|�|
dt|
�t|
�|j��q.|t	|�||fSr�)
r�r�r.ZCMSG_LEN�itemsizer�r�Z	frombytesr��list)rL�bufsizeZmaxfdsr�r��msgZancdatarNZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrr�recv_fds2s
��
r�ZsharecCstddd|�S�Nr)r')�inforrr�	fromshareFsr�c
	Cs\|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|��|�	�dd�\}}t|||�}zN|�
d�z|�||f�Wntt
fy�Yn0|�
d�|��\}}	Wn|���Yn0W|��n
|��0z0|�	�|��k�s*|�	�|��k�r2td��Wn|��|���Yn0||fS)	Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FTzUnexpected peer connection)r,�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr-r'�bind�listenr>rM�connectru�InterruptedErrorrOr7rA�ConnectionError)
r1r2r3�hostZlsockrN�portZcsockZssock�_rrr�_fallback_socketpairRsL


��r��
socketpaircCsf|dur(zt}Wnty&t}Yn0t�|||�\}}t||||���}t||||���}||fSr)ZAF_UNIX�	NameErrorr,r.r�r'r�)r1r2r3�arUrrrr��s
a8socketpair([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.
csleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Z�fdd�Zd
d�Z	e
dd��Ze
dd��Zdd�Z
�ZS)rXcCsZ|dvrtd|��tj�|�||_d|vr6|d7}||_d|v|_d|v|_d|_dS)N)rPrTZrw�rb�wbZrwbzinvalid mode: %rrUrPrTF)	rrY�	RawIOBaser/�_sock�_mode�_reading�_writing�_timeout_occurred)r0rLr_rrrr/�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStyFd|_�Yqty�}z*|jdt	vrpWYd}~dS�WYd}~qd}~00qdS)Nz!cannot read from timed out objectTr)
�_checkClosed�_checkReadabler�ror�Z	recv_intortr@r8�_blocking_errnos�r0rU�errr�readinto�szSocketIO.readintoc
Csf|��|��z|j�|�WSty`}z*|jdtvrJWYd}~dS�WYd}~n
d}~00dSr�)r��_checkWritabler�r�r@r8r�r�rrr�write�szSocketIO.writecCs|jrtd��|jS�NzI/O operation on closed socket.)rBrr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jSr�)rBrr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���Sr�)rBrr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��Sr)r�r�r4r5rrrr4�szSocketIO.filenocCs|js|��SdSdS)Nr+)rBr4r5rrrr�sz
SocketIO.namecCs|jSr)r�r5rrrr_sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dSr)rBrYr�r7r�r�r5rrrr7s

zSocketIO.close)r$r%r&r/r�r�r�r�r�r4r�r�r_r7r�rrr�rrX�s

rXr:cCsj|��}|r|dkrt�}zt|�\}}}Wnty>Yn(0|�d|�|D]}d|vrPqfqP|}|S)Nz0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrrs
rcCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|turP|�|�|r^|�|�|�|�d}|WSty�}
z |
}|dur�|��WYd}
~
qd}
~
00q|dur�z|�Wd}q�d}0ntd��dS)Nrz!getaddrinfo returns an empty list)	�getaddrinfor-r'�_GLOBAL_DEFAULT_TIMEOUTrIr�r�r@r7)r�rtZsource_addressr�r�ry�res�af�socktyper3�	canonname�sarLr�rrrr3s.



 rcCsvtrttd�rttd�sdSz@ttt��"}|�ttd�Wd�WdS1sP0YWnt	ypYdS0dS)N�IPPROTO_IPV6�IPV6_V6ONLYFrT)
�has_ipv6rqr.r'r�r-�
setsockoptr�r�r@)rLrrrr`s��&rF)r1�backlog�
reuse_port�dualstack_ipv6c
Csl|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdvr�ttd�r�z|�	t
td�Wnty~Yn0|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�WnBt�y$}z(d|j|f}t|j|�d�WYd}~n
d}~00|du�r:|��n
|�|�|WSt�yf|���Yn0dS)N�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_REUSEADDRrVrr�r�z+%s (while attempting to bind on address %r))rqr.rrr�r'r-rlr�r�r�r�r@r�r�r�r�r��strerror�errnor�r7)r�r1r�r�r�rLryr�rrrr
psN


�
��$


r
cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|Sr)r.r��appendrrr)r�r�r1r2r3r�Zaddrlistr�r�r�r�r�rrrr��s�r�)r)rN)r)r:)rrrr)3r.rl�sysrYrr�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r$r�r�r�platform�lowerrr"r��	Exceptionr#r'r
rqr�r�r�r�r,r-r�r�r�r�r�rXr�objectr�rrr
r�rrrr�<module>3sN 
����
F
	




6
u
�
-�E