Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/socket.cpython-37.opt-2.pyc

B

YI~dMk�@slddlZddlTddlZddlZddlZddlZddlmZmZyddlZWne	k
rddZYnXe
edd�Ze
edd�Ze
edd�Z
d	d
ddd
gZe�e�e��e�dedd��e�d
edd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r�iZded<ded<ded<d ed!<d"ed#<d$ed%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d0ed1<d2ed3<d4ed5<d6ed7<e�d8�Gd9d:�d:e�ZGd;d<�d<ej�ZdLd=d	�Ze ejd>��r�d?d@�Z!e�d@�e edA��rde"dfdBdA�Z#ne$e"dfdCdA�Z#e�dA�dDe#_%ee
hZ&GdEdF�dFej'�Z(dMdHd
�Z)e*�Z+e+dfdId�Z,dNdJdK�Z-dS)O�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_)�isupper�
startswith)�C�r�+/opt/alt/python37/lib64/python3.7/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_)rr)rrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_)rr)rrrrrVrZAddressInfocCs|��o|�d�S)NZAI_)rr)rrrrr[rz	127.0.0.1z::1cCs"y||�Stk
r|SXdS)N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converterasr�winzThe 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&'z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zThe network address is in use.i@'zThe connection has been reset.iF'zThe network has been shut down.iJ'zThe operation timed out.iL'zConnection refused.iM'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr�srcs(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|S)Nr)r(rrr�	__enter__�szsocket.__enter__cGs|js|��dS)N)r"�close)r(�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�y |��}|r^|dt	|�7}Wnt
k
rtYnXy |��}|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__rrr,r)r*r+�getsockname�str�errorZgetpeername)r(�closed�sZladdrZraddrrrr�__repr__�s0

zsocket.__repr__cCstd��dS)NzCannot serialize socket object)�	TypeError)r(rrr�__getstate__�szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)N)r,)�dupr,r4r)r*r+�
settimeout�
gettimeout)r(�fd�sockrrrr=�sz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)N)r,T)Z_acceptrr)r*r+Zgetdefaulttimeoutr?�setblocking)r(r@�addrrArrr�accept�s

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)
NrE�w�bz&invalid mode %r (only r, w, b allowed)r1�r#rz!unbuffered streams must be binary)�setr�SocketIOr!�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r(rT�	bufferingrFrGrHZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile�s<
zsocket.makefile�sendfilerc
Cs�|�|||�|��}y|��}Wn0ttjfk
rR}zt|��Wdd}~XYnXyt�|�j}Wn*t	k
r�}zt|��Wdd}~XYnX|s�dS|s�|n|}|�
�}	|	dkr�td��tt
d�r�t
��}
nt
��}
|
�|t
j�d}|
j}tj}
z�x�|	�r||	��st�d��|�r.||}|dk�r.Py|
||||�}Wn^tk
�rd|	�s^|�w�Yq�t	k
�r�}z|dk�r�t|��|d�Wdd}~XYq�X|dk�r�P||7}||7}q�W|S|dk�r�t|d��r�|�|�XdS)Nrz&non-blocking sockets are not supported�PollSelectorz	timed out�seek)�_check_sendfile_paramsr,�AttributeErrorrN�UnsupportedOperationr�os�fstat�st_size�OSErrorr?r�hasattr�	selectorsr[ZSelectSelector�registerZEVENT_WRITEZselectrZr&�timeout�BlockingIOErrorr\)r(�file�offset�countZsocknor,�errZfsize�	blocksizergZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfile	s`





zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r)r(rirjrkrrrrpJsc

Cs|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�x�|rrt|||�}|dkrrPt||��}|s�PxLy||�}	Wntk
r�w�Yq�X||	7}|	t	|�kr�||	d�}q�Pq�WqVW|S|dkr�t
|d�r�|�||�XdS)Nrz&non-blocking sockets are not supportedi r\)r]r?rr\�min�read�send�
memoryviewrh�lenrd)
r(rirjrkrmrnZ	file_readZ	sock_send�datarorrr�_sendfile_use_sendNs<

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrJrTz$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r3rr*r%�
isinstance�intr;�format)r(rirjrkrrrr]rs

zsocket._check_sendfile_paramscCs2y|�|||�Stk
r,|�|||�SXdS)N)rprrw)r(rirjrkrrrrZszsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrK)r!r"r.)r(rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dS)N)r.)r(Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r"r!r|)r(rrrr.�s
zsocket.closecsd|_t���S)NT)r"�super�detach)r()r4rrr~�sz
socket.detachcstt�jt�S)N)rr}r)r
)r()r4rrr)�sz
socket.familycstt�jt�S)N)rr}r*r)r()r4rrr*�szsocket.type�ntcCst�|���S)N)r`Zget_handle_inheritabler,)r(rrr�get_inheritable�szsocket.get_inheritablecCst�|��|�dS)N)r`Zset_handle_inheritabler,)r(�inheritablerrr�set_inheritable�szsocket.set_inheritablecCst�|���S)N)r`r�r,)r(rrrr��scCst�|��|�dS)N)r`r�r,)r(r�rrrr��sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r#r#r#N)rEN)rN)rN)rN)rN) rrr�	__slots__r'r-r0r:r<r=rDrYrdr`rprwr]rZr{r&rr|r.r~�propertyr)r*�namer�r��__doc__�
__classcell__rr)r4rr�s:

)
A

$


rcCst|�}t||||�S)N)r=r)r@r)r*r+Znfdrrrr
�sZsharecCstddd|�S)Nr)r)�inforrr�	fromshare�sr��
socketpaircCsh|dkr*yt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fS)N)ZAF_UNIX�	NameErrorr$r&r�rr~)r)r*r+�arJrrrr��s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|��|�	�dd�\}}t|||�}yP|�
d�y|�||f�Wntt
fk
r�YnX|�
d�|��\}}	Wn|���YnXWd|��X||fS)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$�
_LOCALHOSTZAF_INET6�
_LOCALHOST_V6rr%r�bindZlistenr5rB�connectrh�InterruptedErrorrDr.)
r)r*r+�hostZlsockrC�portZcsockZssock�_rrrr��s8


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)rMcCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rErI�rw�rb�wbZrwbzinvalid mode: %rrJrErIF)	rrN�	RawIOBaser'�_sock�_mode�_reading�_writing�_timeout_occurred)r(rArTrrrr'3s

zSocketIO.__init__c
Cs�|��|��|jrtd��xby|j�|�Stk
rHd|_�Yq tk
r|}z|jdt	krjdS�Wdd}~XYq Xq WdS)Nz!cannot read from timed out objectTr)
�_checkClosed�_checkReadabler�rcr�Z	recv_intorgr7r/�_blocking_errnos)r(rJ�errr�readinto?szSocketIO.readintoc
CsX|��|��y|j�|�Stk
rR}z|jdtkr@dS�Wdd}~XYnXdS)Nr)r��_checkWritabler�rsr7r/r�)r(rJr�rrr�writeVszSocketIO.writecCs|jrtd��|jS)NzI/O operation on closed socket.)r8rr�)r(rrr�readablefszSocketIO.readablecCs|jrtd��|jS)NzI/O operation on closed socket.)r8rr�)r(rrr�writablemszSocketIO.writablecs|jrtd��t���S)NzI/O operation on closed socket.)r8rr}�seekable)r()r4rrr�tszSocketIO.seekablecCs|��|j��S)N)r�r�r,)r(rrrr,{szSocketIO.filenocCs|js|��SdSdS)Nr#)r8r,)r(rrrr��sz
SocketIO.namecCs|jS)N)r�)r(rrrrT�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dS)N)r8rNr�r.r�r{)r(rrrr.�s

zSocketIO.close)rrrr'r�r�r�r�r�r,r�r�rTr.r�rr)r4rrM"srMr1cCsn|��}|r|dkrt�}yt|�\}}}Wntk
r@Yn*X|�d|�x|D]}d|krTPqTW|}|S)Nz0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr7�insert)r�Zhostname�aliasesZipaddrsrrrr�s	
cCs�|\}}d}x�t||dt�D]�}|\}}}	}
}d}y>t|||	�}|tk	rR|�|�|r`|�|�|�|�d}|Stk
r�}
z|
}|dk	r�|��Wdd}
~
XYqXqW|dk	r�z|�Wdd}Xntd��dS)Nrz!getaddrinfo returns an empty list)	�getaddrinfor%r�_GLOBAL_DEFAULT_TIMEOUTr>r�r�r7r.)ZaddressrgZsource_addressr�r�rl�res�af�socktyper+�	canonname�sarAr�rrrr�s.


cCsTg}xJt�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�qW|S)N)r&r��appendrr
r)r�r�r)r*r+�flagsZaddrlistr�r�r�r�r�rrrr��sr�)r)r1)rrrr).r&r`�sysrNre�enumrr�errno�ImportErrorr3rrr	�__all__�extend�_get_exports_list�_convertrr�r�rrZ_realsocket�platform�lowerrrr��	Exceptionrr
rdr�r%r�r$r�r�r�rMr�objectr�rr�rrrr�<module>1s� 






F
	
$
u
+

Hacked By AnonymousFox1.0, Coded By AnonymousFox