Hacked By AnonymousFox

Current Path : /opt/alt/python38/lib64/python3.8/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/__pycache__/socket.cpython-38.opt-2.pyc

U

i�f���@sddlZddlTddlZddlZddlZddlZddlmZmZzddlZWne	k
rddZYnXe
edd�Ze
edd�Ze
edd�Z
d	d
ddd
ddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r iZded<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�<d�ed�<d�ed�<e�dءGd�dڄd�e�ZGd�d܄d�ej�Zd�d�d	�Ze ejdރ�rld�d�Z!e�d�e"e#dfd�d�Z$e ed��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
�Z.e"dd�d�d�d�d�Z/d�d�d�Z0dS)��N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�+/opt/alt/python38/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS�N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
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#�sr#cs(eZdZdddgZd8dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
d9dddd�dd�Zee
d�rvd:dd�Zn
d;dd�Zd<dd�Zdd �Zd=d!d"�Zd#d$�Zejfd%d&�Zd'd(�Z�fd)d*�Ze�fd+d,��Ze�fd-d.��Ze
jd/k�rd0d1�Zd2d3�Znd4d1�Zd5d3�Zd6e_d7e_�ZS)>�socket�__weakref__�_io_refs�_closed���NcCsP|dkr,|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
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|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�dkr>|��r>|�d�||fS)NrGT)Z_acceptr'r1r2r3ZgetdefaulttimeoutrJ�setblocking)r0rK�addrrLrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�dddhks td|f��d|k}d|kp4|}d|k}d}	|rN|	d7}	|rZ|	d7}	t||	�}
|jd7_|dkr~d}|dkr�tj}|dkr�|s�td	��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)
NrP�w�bz&invalid mode %r (only r, w, b allowed)r:�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|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr4�AttributeErrorrY�UnsupportedOperationr#�os�fstat�st_size�OSError�minrJr�hasattr�	selectorsrgZSelectSelector�registerZEVENT_WRITEZselectrerhr.�timeout�BlockingIOError)r0�file�offset�countZsocknor4�errZfsize�	blocksizertZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






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||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrfi rh)rirJrrhrp�read�sendrq�
memoryviewru�len)
r0rvrwrxrzr{Z	file_readZ	sock_send�datar|rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`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_paramscCs8z|�|||�WStk
r2|�|||�YSXdSr)r}r#r�r~rrrre�szsocket.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_inheritable
szsocket.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'�sD

�*
A

$


r'cCst|�}t||||�Sr)rHr')rKr1r2r3Znfdrrrr
sZsharecCstddd|�S�Nr)r')�inforrr�	fromshare#sr�c
	CsV|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��Xz0|�
�|��k�s$|�
�|��k�r,td��Wn|��|���YnX||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'r7�bind�listenr>rM�connectru�InterruptedErrorrOrA�ConnectionError)
r1r2r3�hostZlsockrN�portZcsockZssock�_rrr�_fallback_socketpair/sL


��r��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fSr)ZAF_UNIX�	NameErrorr,r.r�r'r�)r1r2r3�arUrrrr�fs
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|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_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�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)Nz!cannot read from timed out objectTr)
�_checkClosed�_checkReadabler�ror�Z	recv_intortr@r8�_blocking_errnos�r0rU�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdSr�)r��_checkWritabler�r�r@r8r�r�rrr�write�s
zSocketIO.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�r5rrrr7�s

zSocketIO.close)r$r%r&r/r�r�r�r�r�r4r�r�r_r7r�rrr�rrX~s

rXr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)Nz0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)Nrz!getaddrinfo returns an empty list)	�getaddrinfor-r'�_GLOBAL_DEFAULT_TIMEOUTrIr�r�r@r7)�addressrtZsource_addressr�r�ry�res�af�socktyper3�	canonname�sarLr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)N�IPPROTO_IPV6�IPV6_V6ONLYFrT)
�has_ipv6rqr.r'r�r-�
setsockoptr�r�r@)rLrrrr<s��F)r1�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)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�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r1r�r�r�rLry�msgrrrr
LsN


�
�� 


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

F
	
6
u
�
-�E

Hacked By AnonymousFox1.0, Coded By AnonymousFox