AlkantarClanX12

Your IP : 18.118.119.129


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/socketserver.cpython-39.opt-2.pyc

a

R�f�j�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Zgd�Z
eed�rde
�gd��eed�r|e
�gd	��eed
�r�ej
ZnejZGdd�d�ZGd
d�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd�d�ZGdd�d�Zeed��r6Gdd�dee�ZGdd�dee�ZGdd�dee�ZGdd �d ee�Zeed��r�Gd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&ee�ZGd'd(�d(ee�ZGd)d*�d*�Z Gd+d,�d,e �Z!Gd-d.�d.e�Z"Gd/d0�d0e �Z#dS)1z0.4�N)�BufferedIOBase)�	monotonic)	�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork)�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX)�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdd�Zdd�Zd%dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&rNcCs ||_||_t��|_d|_dS�NF)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�1/opt/alt/python39/lib64/python3.9/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�Nr�rrrr�server_activate�szBaseServer.server_activate��?cCs�|j��zvt��L}|�|tj�|jsP|�|�}|jr:qP|rF|��|�	�q"Wd�n1sd0YWd|_|j�
�nd|_|j�
�0dSr)r�clear�_ServerSelector�register�	selectors�
EVENT_READr�select�_handle_request_noblock�service_actions�set)rZ
poll_interval�selector�readyrrr�
serve_forever�s

*�zBaseServer.serve_forevercCsd|_|j��dS�NT)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdSr!rr"rrrr,�szBaseServer.service_actionscCs�|j��}|dur|j}n|jdur0t||j�}|durBt�|}t��t}|�|tj�|�	|�}|r||�
�Wd�S|durX|t�}|dkrX|��Wd�SqXWd�n1s�0YdS)Nr)�socketZ
gettimeout�timeout�min�timer&r'r(r)r*r+�handle_timeout)rr5Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wnty$YdS0|�||�r�z|�||�Wq�tyj|�||�|�|�Yq�|�|��Yq�0n
|�|�dSr!)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr+/s

z"BaseServer._handle_request_noblockcCsdSr!rr"rrrr8FszBaseServer.handle_timeoutcCsdSr1rrArrrr<MszBaseServer.verify_requestcCs|�||�|�|�dSr!)�finish_requestr@rArrrr=UszBaseServer.process_requestcCsdSr!rr"rrr�server_close^szBaseServer.server_closecCs|�|||�dSr!)rrArrrrDfszBaseServer.finish_requestcCs|�|�dSr!��
close_request�rrBrrrr@jszBaseServer.shutdown_requestcCsdSr!rrHrrrrGnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)Nz(----------------------------------------)�filez4Exception occurred during processing of request fromr)�print�sys�stderr�	traceback�	print_exc)rrBrCrMrrrr?rs�zBaseServer.handle_errorcCs|Sr!rr"rrr�	__enter__szBaseServer.__enter__cGs|��dSr!)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__r5r r#r0r3r,r9r+r8r<r=rErDr@rGr?rOrQrrrrr�s$-

	
rc@sbeZdZejZejZdZdZ	ddd�Z
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�ZdS)r�FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���Yn0dSr!)rr r4�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)N�)�allow_reuse_addressr4�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrrX�szTCPServer.server_bindcCs|j�|j�dSr!)r4Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSr!)r4�closer"rrrrE�szTCPServer.server_closecCs
|j��Sr!)r4�filenor"rrrr^�szTCPServer.filenocCs
|j��Sr!)r4Zacceptr"rrrr:�szTCPServer.get_requestcCs2z|�tj�Wnty"Yn0|�|�dSr!)r3r4ZSHUT_WRr;rGrHrrrr@�s
zTCPServer.shutdown_requestcCs|��dSr!)r]rHrrrrG�szTCPServer.close_requestN)T)rRrSrTr4ZAF_INETrVZSOCK_STREAMrWr\rZr rXr#rEr^r:r@rGrrrrr�s/


rc@s:eZdZdZejZdZdd�Zdd�Z	dd�Z
d	d
�ZdS)rFi cCs |j�|j�\}}||jf|fSr!)r4Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr:szUDPServer.get_requestcCsdSr!rr"rrrr#szUDPServer.server_activatecCs|�|�dSr!rFrHrrrr@szUDPServer.shutdown_requestcCsdSr!rrHrrrrGszUDPServer.close_requestN)rRrSrTrZr4Z
SOCK_DGRAMrWr_r:r#r@rGrrrrrsrcsReZdZdZdZdZdZdd�dd�Zd	d
�Zdd�Z	d
d�Z
�fdd�Z�ZS)ri,N�(TF��blockingc	Cs�|jdurdSt|j�|jkrrz t�dd�\}}|j�|�WqtyZ|j��YqtynYqrYq0q|j�	�D]b}z.|r�dntj
}t�||�\}}|j�|�Wq|ty�|j�|�Yq|ty�Yq|0q|dS)N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r;�copy�WNOHANG)rrc�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dSr!�rqr"rrrr8KszForkingMixIn.handle_timeoutcCs|��dSr!rrr"rrrr,RszForkingMixIn.service_actionscCs�t��}|r8|jdurt�|_|j�|�|�|�dSd}z^z|�||�d}Wntyp|�||�Yn0Wz|�	|�Wt�
|�q�t�
|�0n(z|�	|�Wt�
|�nt�
|�00dS)NrYr)rhr
rer-�addrGrDr>r?r@�_exit)rrBrCrnZstatusrrrr=Ys&

�zForkingMixIn.process_requestcst���|j|jd�dS)Nrb)�superrErq�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)
rRrSrTr5rergrvrqr8r,r=rE�
__classcell__rrrwrrs#rcs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	�_Threadscs"|��|jrdSt��|�dSr!)�reap�daemonru�append�r�threadrwrrr}{sz_Threads.appendcCsg|dd�|dd�<}|Sr!r)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSr!)r��joinr~rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSr!)Zis_alive)�.0rrrr�	<genexpr>��z _Threads.reap.<locals>.<genexpr>rr"rrrr{�sz
_Threads.reap)rRrSrTr}r�r�r{ryrrrwrrzwsrzc@seZdZdd�Zdd�ZdS)�
_NoThreadscCsdSr!rr~rrrr}�sz_NoThreads.appendcCsdSr!rr"rrrr��sz_NoThreads.joinN)rRrSrTr}r�rrrrr��sr�cs:eZdZdZdZe�Zdd�Zdd�Z�fdd�Z	�Z
S)	rFTc	CsPz>z|�||�Wnty0|�||�Yn0W|�|�n|�|�0dSr!)rDr>r?r@rArrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)N�_threads)�targetrP)rv�vars�
setdefaultrzrZThreadr��daemon_threadsr|r�r}�start)rrBrC�trrrr=�s�zThreadingMixIn.process_requestcst���|j��dSr!)rurEr�r�r"rwrrrE�s
zThreadingMixIn.server_close)rRrSrTr�rvr�r�r�r=rEryrrrwrr�s

rc@seZdZdS)rN�rRrSrTrrrrr�r�rc@seZdZdS)rNr�rrrrr�r�rc@seZdZdS)rNr�rrrrr�r�rc@seZdZdS)rNr�rrrrr�r�rc@seZdZejZdS)rN�rRrSrTr4rrVrrrrr�src@seZdZejZdS)rNr�rrrrr�src@seZdZdS)rNr�rrrrr�r�rc@seZdZdS)rNr�rrrrr�r�rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r	cCs>||_||_||_|��z|��W|��n
|��0dSr!)rBrC�server�setup�handle�finish)rrBrCr�rrrr �s
zBaseRequestHandler.__init__cCsdSr!rr"rrrr��szBaseRequestHandler.setupcCsdSr!rr"rrrr��szBaseRequestHandler.handlecCsdSr!rr"rrrr��szBaseRequestHandler.finishN)rRrSrTr r�r�r�rrrrr	�s
r	c@s,eZdZdZdZdZdZdd�Zdd�ZdS)	r
rdrNFcCsz|j|_|jdur |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rBZ
connectionr5Z
settimeout�disable_nagle_algorithmr[r4ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsD|jjs,z|j��Wntjy*Yn0|j��|j��dSr!)r��closed�flushr4�errorr]r�r"rrrr�#s
zStreamRequestHandler.finish)	rRrSrTr�r�r5r�r�r�rrrrr
s
r
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs
||_dSr!)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdSr1rr"rrr�writable6sz_SocketWriter.writablecCs>|j�|�t|��}|jWd�S1s00YdSr!)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��Sr!)r�r^r"rrrr^>sz_SocketWriter.filenoN)rRrSrTr r�r�r^rrrrr�.sr�c@seZdZdd�Zdd�ZdS)rcCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rBZpacketr4r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSr!)r4Zsendtor��getvaluerCr"rrrr�KszDatagramRequestHandler.finishN)rRrSrTr�r�rrrrrAsr)$�__version__r4r(rhrKrr�rr7r�__all__�hasattr�extendrr&ZSelectSelectorrrrr�listrzr�rrrrrrrrrr	r
r�rrrrr�<module>{sL


n~
X(.-