Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3.10/asyncio/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3.10/asyncio/__pycache__/selector_events.cpython-310.pyc
o

�*�g��@s$dZdZddlZddlZddlZddlZddlZddlZddlZzddl	Z	Wne
y1dZ	YnwddlmZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdd�ZGdd�dej�ZGdd�dejej�ZGdd�de�ZGdd�de�ZdS)z�Event loop using a selector and related classes.

A selector is a "notify-when-ready" multiplexer.  For a subclass which
also includes support for signal handling, see the unix_events sub-module.
)�BaseSelectorEventLoop�N�)�base_events)�	constants)�events)�futures)�	protocols)�sslproto)�
transports)�trsock)�loggercCs2z|�|�}Wn
tyYdSwt|j|@�S�NF)�get_key�KeyError�boolr)�selector�fd�event�key�r�./usr/lib/python3.10/asyncio/selector_events.py�_test_selector_event s�rcs�eZdZdZdS�fdd�	ZdSddd�dd�Z	dSddddejd	�d
d�Z	dTdd
�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdddejfdd�Zdddejfdd�Zddejfdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdSd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dSdEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+�Z,S)UrzJSelector event loop.

    See events.EventLoop for API specification.
    NcsFt���|dur
t��}t�d|jj�||_|�	�t
��|_dS)NzUsing selector: %s)
�super�__init__�	selectors�DefaultSelectorr�debug�	__class__�__name__�	_selector�_make_self_pipe�weakref�WeakValueDictionary�_transports)�selfr�rrrr1s
zBaseSelectorEventLoop.__init__��extra�servercC�t||||||�S�N)�_SelectorSocketTransport)r$�sock�protocol�waiterr'r(rrr�_make_socket_transport;s
�z,BaseSelectorEventLoop._make_socket_transportF)�server_side�server_hostnamer'r(�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r2r&)r	�SSLProtocolr+�_app_transport)r$�rawsockr-�
sslcontextr.r0r1r'r(r2�ssl_protocolrrr�_make_ssl_transport@s��z)BaseSelectorEventLoop._make_ssl_transportcCr)r*)�_SelectorDatagramTransport)r$r,r-�addressr.r'rrr�_make_datagram_transportMs�z.BaseSelectorEventLoop._make_datagram_transportcsP|��rtd��|��rdS|��t���|jdur&|j��d|_dSdS)Nz!Cannot close a running event loop)�
is_running�RuntimeError�	is_closed�_close_self_piper�closer�r$r%rrr@Rs



�zBaseSelectorEventLoop.closecCsB|�|j���|j��d|_|j��d|_|jd8_dS)Nr)�_remove_reader�_ssock�filenor@�_csock�
_internal_fdsrArrrr?]s

z&BaseSelectorEventLoop._close_self_pipecCsNt��\|_|_|j�d�|j�d�|jd7_|�|j��|j�dS)NFr)	�socket�
socketpairrCrE�setblockingrF�_add_readerrD�_read_from_selfrArrrr es
z%BaseSelectorEventLoop._make_self_pipecCsdSr*r�r$�datarrr�_process_self_datam�z(BaseSelectorEventLoop._process_self_datacCsN	z|j�d�}|s
WdS|�|�WntyYqty%YdSwq)NTi)rC�recvrN�InterruptedError�BlockingIOErrorrLrrrrKps��z%BaseSelectorEventLoop._read_from_selfcCsR|j}|dur	dSz|�d�WdSty(|jr%tjddd�YdSYdSw)N�z3Fail to write a null byte into the self-pipe socketT��exc_info)rE�send�OSError�_debugrr)r$�csockrrr�_write_to_self|s���z$BaseSelectorEventLoop._write_to_self�dc
Cs"|�|��|j||||||�dSr*)rJrD�_accept_connection)r$�protocol_factoryr,r6r(�backlogr2rrr�_start_serving�s
�z$BaseSelectorEventLoop._start_servingc
Cst|�D]}}z|��\}}	|jrt�d||	|�|�d�WnOtttfy,YdSt	ym}
z6|
j
t
jt
jt
j
t
jfvrb|�d|
t�|�d��|�|���|�tj|j||||||�n�WYd}
~
qd}
~
wwd|	i}|�||||||�}|�|�qdS)Nz#%r got a new connection from %r: %rFz&socket.accept() out of system resource)�message�	exceptionrG�peername)�range�acceptrXrrrIrRrQ�ConnectionAbortedErrorrW�errno�EMFILE�ENFILE�ENOBUFS�ENOMEM�call_exception_handlerr�TransportSocketrBrD�
call_laterr�ACCEPT_RETRY_DELAYr_�_accept_connection2�create_task)
r$r]r,r6r(r^r2�_�conn�addr�excr'rdrrrr\�sH�������
��z(BaseSelectorEventLoop._accept_connectionc
�s��d}d}z7|�}|��}	|r|j||||	d|||d�}n
|j|||	||d�}z	|	IdHWWdSty<|���wttfyF�ty|}
z+|jrqd|
d�}|dur]||d<|dure||d<|�|�WYd}
~
dSWYd}
~
dSd}
~
ww)NT)r.r0r'r(r2)r.r'r(z3Error on transport creation for incoming connection)r`rar-�	transport)	�
create_futurer8r/�
BaseExceptionr@�
SystemExit�KeyboardInterruptrXrk)r$r]rrr'r6r(r2r-rur.rt�contextrrrro�sJ��������z)BaseSelectorEventLoop._accept_connection2c
Cs�|}t|t�s"zt|���}Wntttfy!td|���d�wz|j|}Wn
ty3YdSw|��sBt	d|�d|����dS)NzInvalid file object: zFile descriptor z is used by transport )
�
isinstance�intrD�AttributeError�	TypeError�
ValueErrorr#r�
is_closingr=)r$rrDrurrr�_ensure_fd_no_transport�s&
�����z-BaseSelectorEventLoop._ensure_fd_no_transportc		Gs�|��t�|||d�}z|j�|�}Wnty)|j�|tj|df�Y|Sw|j|j	}\}}|j�
||tjB||f�|durH|��|Sr*)�
_check_closedr�Handlerrr�registerr�
EVENT_READrM�modify�cancel�	r$r�callback�args�handler�mask�reader�writerrrrrJ��"���z!BaseSelectorEventLoop._add_readercCs�|��rdSz|j�|�}Wn
tyYdSw|j|j}\}}|tjM}|s1|j�|�n
|j�	||d|f�|durE|�
�dSdS)NFT)r>rrrrrMrr��
unregisterr�r��r$rrr�r�r�rrrrBs �z$BaseSelectorEventLoop._remove_readerc		Gs�|��t�|||d�}z|j�|�}Wnty)|j�|tjd|f�Y|Sw|j|j	}\}}|j�
||tjB||f�|durH|��|Sr*)r�rr�rrrr�r�EVENT_WRITErMr�r�r�rrr�_add_writer!r�z!BaseSelectorEventLoop._add_writercCs�|��rdSz|j�|�}Wn
tyYdSw|j|j}\}}|tjM}|s1|j�|�n
|j�	|||df�|durE|�
�dSdS)�Remove a writer callback.FNT)r>rrrrrMrr�r�r�r�r�rrr�_remove_writer1s �z$BaseSelectorEventLoop._remove_writercG�"|�|�|j||g|�R�dS)zAdd a reader callback.N)r�rJ�r$rr�r�rrr�
add_readerH�
z BaseSelectorEventLoop.add_readercC�|�|�|�|�S)zRemove a reader callback.)r�rB�r$rrrr�
remove_readerM�

z#BaseSelectorEventLoop.remove_readercGr�)zAdd a writer callback..N)r�r�r�rrr�
add_writerRr�z BaseSelectorEventLoop.add_writercCr�)r�)r�r�r�rrr�
remove_writerWr�z#BaseSelectorEventLoop.remove_writerc	���t�|�|jr|��dkrtd��z|�|�WSttfy$Ynw|��}|�	�}|�
|�|�||j|||�}|�
tj|j||d��|IdHS)z�Receive data from the socket.

        The return value is a bytes object representing the data received.
        The maximum amount of data to be received at once is specified by
        nbytes.
        r�the socket must be non-blocking�r�N)r�_check_ssl_socketrX�
gettimeoutrrPrRrQrvrDr�rJ�
_sock_recv�add_done_callback�	functools�partial�_sock_read_done)r$r,�n�futrr�rrr�	sock_recv\s"�
�
�
zBaseSelectorEventLoop.sock_recvcC�"|dus|��s|�|�dSdSr*)�	cancelledr��r$rr�r�rrrr�r��z%BaseSelectorEventLoop._sock_read_donec
C�|��rdSz|�|�}Wn,ttfyYdSttfy"�ty9}z|�|�WYd}~dSd}~ww|�|�dSr*)	�donerPrRrQrxryrw�
set_exception�
set_result)r$r�r,r�rMrtrrrr�vs��z BaseSelectorEventLoop._sock_recvc	�r�)z�Receive data from the socket.

        The received data is written into *buf* (a writable buffer).
        The return value is the number of bytes written.
        rr�r�N)rr�rXr�r�	recv_intorRrQrvrDr�rJ�_sock_recv_intor�r�r�r�)r$r,�bufr�rr�rrr�sock_recv_into�s"�
�
�
z$BaseSelectorEventLoop.sock_recv_intoc
Cr�r*)	r�r�rRrQrxryrwr�r�)r$r�r,r��nbytesrtrrrr��s��z%BaseSelectorEventLoop._sock_recv_intoc	�s��t�|�|jr|��dkrtd��z|�|�}Wn
ttfy'd}Ynw|t|�kr0dS|�	�}|�
�}|�|�|�||j
||t|�|g�}|�tj|j||d��|IdHS)a�Send data to the socket.

        The socket must be connected to a remote socket. This method continues
        to send data from data until either all data has been sent or an
        error occurs. None is returned on success. On error, an exception is
        raised, and there is no way to determine how much data, if any, was
        successfully processed by the receiving end of the connection.
        rr�Nr�)rr�rXr�rrVrRrQ�lenrvrDr�r��
_sock_sendall�
memoryviewr�r�r��_sock_write_done)r$r,rMr�r�rr�rrr�sock_sendall�s*�
	�

��
z"BaseSelectorEventLoop.sock_sendallc
Cs�|��rdS|d}z|�||d��}Wn,ttfy!YdSttfy*�tyA}z|�|�WYd}~dSd}~ww||7}|t|�krS|�	d�dS||d<dS)Nr)
r�rVrRrQrxryrwr�r�r�)r$r�r,�view�pos�startr�rtrrrr��s$
��z#BaseSelectorEventLoop._sock_sendallc�s��t�|�|jr|��dkrtd��|jtjks"tjr;|jtj	kr;|j
||j|j|j|d�IdH}|d\}}}}}|�
�}|�|||�z|IdHWd}Sd}w)zTConnect to a remote socket at address.

        This method is a coroutine.
        rr�)�family�type�proto�loopN)rr�rXr�rr�rG�AF_INET�	_HAS_IPv6�AF_INET6�_ensure_resolvedr�r�rv�
_sock_connect)r$r,r:�resolvedrqr�rrr�sock_connect�s$�
��
z"BaseSelectorEventLoop.sock_connectc
Cs�|��}zaz|�|�WnEttfy2|�|�|�||j|||�}|�tj	|j
||d��Yn*ttfy;�t
yQ}z|�|�WYd}~nd}~ww|�d�Wd}dSWd}dSWd}dSd}w)Nr�)rD�connectrRrQr�r��_sock_connect_cbr�r�r�r�rxryrwr�r�)r$r�r,r:rr�rtrrrr��s.
�����	�z#BaseSelectorEventLoop._sock_connectcCr�r*)r�r�r�rrrr�r�z&BaseSelectorEventLoop._sock_write_donec
Cs�|��rdSzUz|�tjtj�}|dkrt|d|����Wn*ttfy(Yn*tt	fy1�t
yG}z|�|�WYd}~nd}~ww|�d�Wd}dSWd}dSWd}dSd}w)NrzConnect call failed )
r��
getsockoptrG�
SOL_SOCKET�SO_ERRORrWrRrQrxryrwr�r�)r$r�r,r:�errrtrrrr�s*�����z&BaseSelectorEventLoop._sock_connect_cbc�sD�t�|�|jr|��dkrtd��|��}|�||�|IdHS)aWAccept a connection.

        The socket must be bound to an address and listening for connections.
        The return value is a pair (conn, address) where conn is a new socket
        object usable to send and receive data on the connection, and address
        is the address bound to the socket on the other end of the connection.
        rr�N)rr�rXr�rrv�_sock_accept)r$r,r�rrr�sock_accept*s�

z!BaseSelectorEventLoop.sock_acceptc
Cs�|��}z
|��\}}|�d�WnFttfy7|�|�|�||j||�}|�t	j
|j||d��YdStt
fy@�tyW}z|�|�WYd}~dSd}~ww|�||f�dS)NFr�)rDrdrIrRrQr�rJr�r�r�r�r�rxryrwr�r�)r$r�r,rrrr:r�rtrrrr�9s"

���z"BaseSelectorEventLoop._sock_acceptc	�s��|j|j=|��}|��|��IdHz|j|j|||dd�IdHW|��|r.|��||j|j<S|��|r?|��||j|j<w)NF)�fallback)	r#�_sock_fd�
is_reading�
pause_reading�_make_empty_waiter�
sock_sendfile�_sock�_reset_empty_waiter�resume_reading)r$�transp�file�offset�countr�rrr�_sendfile_nativeJs"�
��z&BaseSelectorEventLoop._sendfile_nativecCs�|D];\}}|j|j}\}}|tj@r&|dur&|jr!|�|�n|�|�|tj@r=|dur=|jr8|�|�q|�|�qdSr*)	�fileobjrMrr��
_cancelledrB�
_add_callbackr�r�)r$�
event_listrr�r�r�r�rrr�_process_eventsXs

��z%BaseSelectorEventLoop._process_eventscCs|�|���|��dSr*)rBrDr@)r$r,rrr�
_stop_servingfsz#BaseSelectorEventLoop._stop_servingr*�NNN)-r�
__module__�__qualname__�__doc__rr/r�SSL_HANDSHAKE_TIMEOUTr8r;r@r?r rNrKrZr_r\ror�rJrBr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr%rr+sl
���
�
�	
�.
�)

rcs�eZdZdZeZdZd�fdd�	Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ejfdd�Zddd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �_SelectorTransportiNcs�t��||�t�|�|jd<z	|��|jd<Wnty&d|jd<Ynwd|jvrEz	|��|jd<Wntj	yDd|jd<Ynw||_
|��|_d|_
|�|�||_|��|_d|_d|_|jdurm|j��||j|j<dS)NrG�socknamerbFr)rrrrl�_extra�getsocknamerW�getpeernamerG�errorr�rDr��_protocol_connected�set_protocol�_server�_buffer_factory�_buffer�
_conn_lost�_closing�_attachr#)r$r�r,r-r'r(r%rrrws0�
�




z_SelectorTransport.__init__cCs�|jjg}|jdur|�d�n|jr|�d�|�d|j���|jdurc|j��sct|jj	|jt
j�}|r=|�d�n|�d�t|jj	|jt
j�}|rQd}nd}|�
�}|�d|�d	|�d
��d�d�|��S)
N�closed�closingzfd=zread=pollingz	read=idle�polling�idlezwrite=<z
, bufsize=�>z<{}>� )rrr��appendr�r��_loopr>rrrr�r��get_write_buffer_size�format�join)r$�infor��state�bufsizerrr�__repr__�s.


�
�z_SelectorTransport.__repr__cCs|�d�dSr*)�_force_closerArrr�abort�sz_SelectorTransport.abortcCs||_d|_dS�NT)�	_protocolr��r$r-rrrr��s
z_SelectorTransport.set_protocolcC�|jSr*)rrArrr�get_protocol��z_SelectorTransport.get_protocolcCrr*)r�rArrrr��rz_SelectorTransport.is_closingcCsX|jrdSd|_|j�|j�|js*|jd7_|j�|j�|j�|jd�dSdS�NTr)	r�rrBr�r�r�r��	call_soon�_call_connection_lostrArrrr@�s�z_SelectorTransport.closecCs0|jdur|d|��t|d�|j��dSdS)Nzunclosed transport )�source)r��ResourceWarningr@)r$�_warnrrr�__del__�s
�z_SelectorTransport.__del__�Fatal error on transportcCsNt|t�r|j��rtjd||dd�n|j�||||jd��|�|�dS)Nz%r: %sTrT)r`rarur-)	r{rWr�	get_debugrrrkrr)r$rtr`rrr�_fatal_error�s

��z_SelectorTransport._fatal_errorcCsd|jrdS|jr|j��|j�|j�|js!d|_|j�|j�|jd7_|j�|j	|�dSr)
r�r��clearrr�r�r�rBrr�r$rtrrrr�s
z_SelectorTransport._force_closecCs�z*|jr
|j�|�W|j��d|_d|_d|_|j}|dur)|��d|_dSdS|j��d|_d|_d|_|j}|durG|��d|_wr*)r�r�connection_lostr�r@rr��_detach)r$rtr(rrrr�s*�

�
�z(_SelectorTransport._call_connection_lostcCs
t|j�Sr*)r�r�rArrrr��
z(_SelectorTransport.get_write_buffer_sizecGs$|jrdS|jj||g|�R�dSr*)r�rrJr�rrrrJ�sz_SelectorTransport._add_reader)NN)r)rr�r��max_size�	bytearrayr�r�rrr
r�rr�r@�warnings�warnrrrrrrJr�rrr%rr�ks"

r�cs�eZdZdZejjZ		d#�fdd�	Z�fdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�fdd�Zdd �Zd!d"�Z�ZS)$r+TNcs�d|_t��|||||�d|_d|_d|_t�|j�|j	�
|jj|�|j	�
|j
|j|j�|dur?|j	�
tj|d�dSdSr
)�_read_ready_cbrr�_eof�_paused�
_empty_waiterr�_set_nodelayr�rrr�connection_maderJr��_read_readyr�_set_result_unless_cancelled)r$r�r,r-r.r'r(r%rrrs
�
��z!_SelectorSocketTransport.__init__cs.t|tj�r|j|_n|j|_t��|�dSr*)r{r�BufferedProtocol�_read_ready__get_bufferr'�_read_ready__data_receivedrr�rr%rrr�s
z%_SelectorSocketTransport.set_protocolcCs|jo|jSr*)r)r�rArrrr�sz#_SelectorSocketTransport.is_readingcCsB|js|jrdSd|_|j�|j�|j��rt�d|�dSdS)NTz%r pauses reading)r�r)rrBr�rrrrArrrr�"s
�z&_SelectorSocketTransport.pause_readingcCsD|js|jsdSd|_|�|j|j�|j��r t�d|�dSdS)NFz%r resumes reading)	r�r)rJr�r-rrrrrArrrr�*s
�z'_SelectorSocketTransport.resume_readingcCs|��dSr*)r'rArrrr-2sz$_SelectorSocketTransport._read_readyc
CsD|jrdSz|j�d�}t|�std��Wn"ttfy�ty7}z
|�|d�WYd}~dSd}~wwz|j	�
|�}Wn-ttfyLYdSttfyU�tym}z
|�|d�WYd}~dSd}~ww|sv|�
�dSz	|j�|�WdSttfy��ty�}z
|�|d�WYd}~dSd}~ww)N���z%get_buffer() returned an empty bufferz/Fatal error: protocol.get_buffer() call failed.�$Fatal read error on socket transportz3Fatal error: protocol.buffer_updated() call failed.)r�r�
get_bufferr�r=rxryrwrr�r�rRrQ�_read_ready__on_eof�buffer_updated)r$r�rtr�rrrr05sP���������z0_SelectorSocketTransport._read_ready__get_bufferc
Cs�|jrdSz	|j�|j�}Wn-ttfyYdSttfy#�ty;}z
|�	|d�WYd}~dSd}~ww|sD|�
�dSz	|j�|�WdSttfyW�tyo}z
|�	|d�WYd}~dSd}~ww)Nr3z2Fatal error: protocol.data_received() call failed.)
r�r�rPr#rRrQrxryrwrr5r�
data_received)r$rMrtrrrr1Zs4�����z3_SelectorSocketTransport._read_ready__data_receivedc
Cs�|j��rt�d|�z|j��}Wn"ttfy�ty4}z
|�	|d�WYd}~dSd}~ww|r@|j�
|j�dS|��dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)
rrrrr�eof_receivedrxryrwrrBr�r@)r$�	keep_openrtrrrr5ss 
���z,_SelectorSocketTransport._read_ready__on_eofc
Cs(t|tttf�stdt|�j����|jrtd��|j	dur"td��|s&dS|j
r=|j
tjkr4t
�d�|j
d7_
dS|js�z|j�|�}Wn,ttfySYn,ttfy\�tyt}z
|�|d�WYd}~dSd}~ww||d�}|sdS|j�|j|j�|j�|�|��dS)N�/data argument must be a bytes-like object, not z%Cannot call write() after write_eof()z(unable to write; sendfile is in progress�socket.send() raised exception.r�%Fatal write error on socket transport)r{�bytesr$r�r~r�rr(r=r*r�r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r�rVrRrQrxryrwrrr�r��_write_ready�extend�_maybe_pause_protocol)r$rMr�rtrrr�write�sB�

��z_SelectorSocketTransport.writec
Cs8|jsJd��|jrdSz	|j�|j�}WnKttfy!YdSttfy*�ty`}z+|j	�
|j�|j��|�
|d�|jdurU|j�|�WYd}~dSWYd}~dSd}~ww|ri|jd|�=|��|js�|j	�
|j�|jdur�|j�d�|jr�|�d�dS|jr�|j�tj�dSdSdS)NzData should not be emptyr<)r�r�r�rVrRrQrxryrwrr�r�rrr*r��_maybe_resume_protocolr�r�rr(�shutdownrG�SHUT_WR)r$r�rtrrrr@�s>

���
�z%_SelectorSocketTransport._write_readycCs2|js|jrdSd|_|js|j�tj�dSdSr)r�r(r�r�rErGrFrArrr�	write_eof�s�z"_SelectorSocketTransport.write_eofcCsdSrrrArrr�
can_write_eof�rOz&_SelectorSocketTransport.can_write_eofcs.t��|�|jdur|j�td��dSdS)NzConnection is closed by peer)rrr*r��ConnectionErrorrr%rrr�s
��z._SelectorSocketTransport._call_connection_lostcCs6|jdur	td��|j��|_|js|j�d�|jS)NzEmpty waiter is already set)r*r=rrvr�r�rArrrr��s
z+_SelectorSocketTransport._make_empty_waitercCs
d|_dSr*)r*rArrrr��r"z,_SelectorSocketTransport._reset_empty_waiterr�)rr�r��_start_tls_compatibler�
_SendfileMode�
TRY_NATIVE�_sendfile_compatiblerr�r�r�r�r-r0r1r5rCr@rGrHrr�r�r�rrr%rr+�s*�%'r+csJeZdZejZ		d�fdd�	Zdd�Zdd�Zd
dd	�Z	d
d�Z
�ZS)r9Ncsbt��||||�||_|j�|jj|�|j�|j|j|j	�|dur/|j�t
j|d�dSdSr*)rr�_addressrrrr,rJr�r-rr.)r$r�r,r-r:r.r'r%rrr�s
�
��z#_SelectorDatagramTransport.__init__cCstdd�|jD��S)Ncss�|]	\}}t|�VqdSr*)r�)�.0rMrqrrr�	<genexpr>�s�zC_SelectorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr�rArrrr�sz0_SelectorDatagramTransport.get_write_buffer_sizec
Cs�|jrdSz|j�|j�\}}WnEttfyYdSty4}z
|j�|�WYd}~dSd}~wt	t
fy=�tyU}z
|�|d�WYd}~dSd}~ww|j�
||�dS)Nz&Fatal read error on datagram transport)r�r��recvfromr#rRrQrWr�error_receivedrxryrwr�datagram_received�r$rMrsrtrrrr-�s ���z&_SelectorDatagramTransport._read_readyc
Cs|t|tttf�stdt|�j����|sdS|jr+|d|jfvr(td|j����|j}|j	rE|jrE|j	t
jkr<t�
d�|j	d7_	dS|js�z|jdrW|j�|�WdS|j�||�WdSttfyt|j�|j|j�Yn:ty�}z
|j�|�WYd}~dSd}~wttfy��ty�}z
|�|d�WYd}~dSd}~ww|j� t|�|f�|�!�dS)Nr:z!Invalid address: must be None or r;rrb�'Fatal write error on datagram transport)"r{r=r$r�r~r�rrNrr�rr>rr?r�r�r�rV�sendtorRrQrr�r��
_sendto_readyrWrrSrxryrwrrrBrUrrrrW
sR�
�

�����z!_SelectorDatagramTransport.sendtoc
Cs|jro|j��\}}z|jdr|j�|�n|j�||�WnLttfy2|j�||f�Yn=t	yJ}z
|j
�|�WYd}~dSd}~wtt
fyS�tyk}z
|�|d�WYd}~dSd}~ww|js|��|js�|j�|j�|jr�|�d�dSdSdS)NrbrV)r��popleftr�r�rVrWrRrQ�
appendleftrWrrSrxryrwrrDrr�r�r�rrUrrrrX8s>
�������z(_SelectorDatagramTransport._sendto_readyr�r*)rr�r��collections�dequer�rrr-rWrXr�rrr%rr9�s�

+r9)r��__all__r[rfr�rrGr%r!�ssl�ImportError�rrrrrr	r
r�logrr�
BaseEventLoopr�_FlowControlMixin�	Transportr�r+r9rrrr�<module>sH�D�o

Spamworldpro Mini