Your IP : 18.217.107.68


Current Path : /opt/alt/python313/lib64/python3.13/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/asyncio/__pycache__/base_events.cpython-313.pyc

�

1}gj7��F�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSK
r
SSKrSSKrSSKrSSKrSSKrSSKJr SSKJr SSKJr SSKJr SSKJr SS	KJr SS
KJr SSKJr SSKJr SS
KJr SSKJr SSKJ r  SSK!J"r" Sr#Sr$Sr%\&"\	S5r'Sr(Sr)Sr*Sr+S&Sjr,S'Sjr-Sr.\&"\	S5(aSr/OSr/Sr0"S S!\Rb5r2"S"S#\Rf5r4"S$S%\Rj5r6g!\a SrN�f=f)(a�Base implementation of event loop.

The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.

Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called.  This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
�N�)�	constants)�
coroutines)�events)�
exceptions)�futures)�	protocols)�sslproto)�	staggered)�tasks)�timeouts)�
transports)�trsock)�logger)�
BaseEventLoop�Server�dg�?�AF_INET6i�Qc��URn[[USS5[R5(a[UR5$[U5$)N�__self__)�	_callback�
isinstance�getattrr�Task�reprr�str)�handle�cbs  �:/opt/alt/python313/lib64/python3.13/asyncio/base_events.py�_format_handler Gs@��	�	�	�B��'�"�j�$�/����<�<��B�K�K� � ��6�{��c�l�U[R:XagU[R:Xag[U5$)Nz<pipe>z<stdout>)�
subprocess�PIPE�STDOUTr)�fds r�_format_piper'Ps+��	�Z�_�_���	�z� � �	 ���B�x�r!c���[[S5(d[S5eUR[R[R
S5 g![a [S5ef=f)N�SO_REUSEPORTz)reuse_port not supported by socket modulerzTreuse_port not supported by socket module, SO_REUSEPORT defined but not implemented.)�hasattr�socket�
ValueError�
setsockopt�
SOL_SOCKETr)�OSError��socks r�_set_reuseportr2Ysc���6�>�*�*��D�E�E�	J��O�O�F�-�-�v�/B�/B�A�F���	J��I�J�
J�	J�s�/A�A(c	��[[S5(dgUS[R[R1;dUcgU[R:Xa[RnO&U[R
:Xa[RnOgUcSnOH[
U[5(a	US:XaSnO*[
U[5(a	US:XaSnO[U5nU[R:Xa<[R/n[(aUR[R 5 OU/n[
U[5(aUR#S5nSU;agUHJn[R$"X�5 [(aU[R :Xa
X�USXXV44s $X�USX44s $ g![[4a gf=f![&a Mrf=f)N�	inet_ptonrr!��idna�%)r*r+�IPPROTO_TCP�IPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAMr�bytesr�int�	TypeErrorr,�	AF_UNSPEC�AF_INET�	_HAS_IPv6�appendr�decoder4r/)	�host�port�family�type�proto�flowinfo�scopeid�afs�afs	         r�_ipaddr_inforMds����6�;�'�'���Q��*�*�F�,>�,>�?�?��L���v�!�!�!��"�"��	
��"�"�	"��"�"����|���	�D�%�	 �	 �T�S�[���	�D�#�	�	�4�2�:���	��t�9�D���!�!�!��~�~����9��J�J�v���'���h���$�����{�{�6�"��
�d�{����	����R�&��y�R�6�?�?�2����T��,K�K�K����T�L�8�8����;�:�&�	��	��2�	��	�s*�F*�<G�G�*F=�<F=�
G�
Gc��[R"5nUH$nUSnXB;a/X$'X$RU5 M& [UR	55n/nUS:�a%URUSSUS-
5 USSUS-
2	URS[RR[R"U6555 U$)z-Interleave list of addrinfo tuples by family.rrNc3�0# �UHnUcMUv� M g7f�N�)�.0�as  r�	<genexpr>�(_interleave_addrinfos.<locals>.<genexpr>�s ����
�a�
�	
��
�s��	)
�collections�OrderedDictrB�list�values�extend�	itertools�chain�
from_iterable�zip_longest)�	addrinfos�first_address_family_count�addrinfos_by_family�addrrF�addrinfos_lists�	reordereds       r�_interleave_addrinfosre�s���&�1�1�3�����a����,�*,��'��#�*�*�4�0�	�
�.�5�5�7�8�O��I�!�A�%������+�,K�-G�!�-K�L�M��A��>� :�Q� >�>�?�
�����?�?�0�0��!�!�?�3�
����r!c���UR5(d,UR5n[U[[45(ag[
R"U5R5 grP)�	cancelled�	exceptionr�
SystemExit�KeyboardInterruptr�	_get_loop�stop)�fut�excs  r�_run_until_complete_cbro�sG���=�=�?�?��m�m�o���c�J�(9�:�;�;�
����c����!r!�TCP_NODELAYc�<�UR[R[R1;anUR[R
:XaOUR[R:Xa0UR[R[RS5 gggg)Nr)
rFr+r@rrGr:rHr8r-rpr0s r�_set_nodelayrr�sj���K�K�F�N�N�F�O�O�<�<��	�	�V�/�/�/��
�
�f�0�0�0��O�O�F�.�.��0B�0B�A�F�1�0�
=r!c��grPrQr0s rrrrr�s��r!c�h�[b+[U[R5(a[S5egg)Nz"Socket cannot be of type SSLSocket)�sslr�	SSLSocketr>r0s r�_check_ssl_socketrw�s*��
��:�d�C�M�M�:�:��<�=�=�;�r!c�J�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
g)
�_SendfileFallbackProtocol��c��[U[R5(d[S5eXlUR5UlUR5UlURUl
UR5 URU5 UR(a*URRR5UlgSUlg)Nz.transport should be _FlowControlMixin instance)rr�_FlowControlMixinr>�
_transport�get_protocol�_proto�
is_reading�_should_resume_reading�_protocol_paused�_should_resume_writing�
pause_reading�set_protocol�_loop�
create_future�_write_ready_fut)�self�transps  r�__init__�"_SendfileFallbackProtocol.__init__�s����&�*�">�">�?�?��L�M�M� ���)�)�+���&,�&7�&7�&9��#�&,�&=�&=��#��������D�!��&�&�$(�O�O�$9�$9�$G�$G�$I�D�!�$(�D�!r!c��# �URR5(a[S5eURnUcgUIShv�N gN7f)NzConnection closed by peer)r}�
is_closing�ConnectionErrorr�)r�rms  r�drain�_SendfileFallbackProtocol.drain�s>����?�?�%�%�'�'�!�"=�>�>��#�#���;���	�	�s�AA
�A�A
c��[S5e)Nz?Invalid state: connection should have been established already.��RuntimeError�r��	transports  r�connection_made�)_SendfileFallbackProtocol.connection_made�s���N�O�	Or!c���URbCUc%URR[S55 OURRU5 URR	U5 g)NzConnection is closed by peer)r��
set_exceptionr�r�connection_lost)r�rns  rr��)_SendfileFallbackProtocol.connection_lost�s[��� � �,��{��%�%�3�3�#�$B�C�E��%�%�3�3�C�8����#�#�C�(r!c�r�URbgURRR5UlgrP)r�r}r�r��r�s r�
pause_writing�'_SendfileFallbackProtocol.pause_writing�s,��� � �,�� $��� 5� 5� C� C� E��r!c�d�URcgURRS5 SUlg�NF)r��
set_resultr�s r�resume_writing�(_SendfileFallbackProtocol.resume_writing�s-��� � �(�����(�(��/� $��r!c��[S5e�Nz'Invalid state: reading should be pausedr�)r��datas  r�
data_received�'_SendfileFallbackProtocol.data_received����D�E�Er!c��[S5er�r�r�s r�eof_received�&_SendfileFallbackProtocol.eof_receivedr�r!c��R# �URRUR5 UR(aURR	5 UR
bUR
R
5 UR(aURR5 gg7frP)	r}r�rr��resume_readingr��cancelr�r�r�s r�restore�!_SendfileFallbackProtocol.restoresr������$�$�T�[�[�1��&�&��O�O�*�*�,�� � �,�
�!�!�(�(�*��&�&��K�K�&�&�(�'�s�B%B')rr�r�r}r�N)�__name__�
__module__�__qualname__�__firstlineno__r�r�r�r�r�r�r�r�r��__static_attributes__rQr!rryry�s3��)��O�	)�F�
%�F�F�
)r!ryc�~�\rSrSrSSjrSrSrSrSrSr	S	r
S
r\S5r
SrS
rSrSrSrSrSrg)riNc��XlX l[R"5Ul/UlX0lXPlX@lX`l	Xpl
SUlSUlgr�)
r��_sockets�weakref�WeakSet�_clients�_waiters�_protocol_factory�_backlog�_ssl_context�_ssl_handshake_timeout�_ssl_shutdown_timeout�_serving�_serving_forever_fut)r��loop�sockets�protocol_factory�ssl_context�backlog�ssl_handshake_timeout�ssl_shutdown_timeouts        rr��Server.__init__sO���
��
� ���)��
���
�!1���
�'��&;�#�%9�"���
�$(��!r!c�R�SURRSUR<S3$)N�<z	 sockets=�>)�	__class__r�r�r�s r�__repr__�Server.__repr__%s'���4�>�>�*�*�+�9�T�\�\�4D�A�F�Fr!c�X�URceURRU5 grP)r�r��addr�s  r�_attach�Server._attach(s$���}�}�(�(�(��
�
���)�$r!c��URRU5 [UR5S:XaURcUR	5 ggg�Nr)r��discard�lenr��_wakeupr�s  r�_detach�Server._detach,s?���
�
���i�(��t�}�}���"�t�}�}�'<��L�L�N�(=�"r!c��URnSUlUH+nUR5(aMURS5 M- grP)r��doner�)r��waiters�waiters   rr��Server._wakeup1s5���-�-����
��F��;�;�=�=��!�!�$�'�r!c
�4�UR(agSUlURHonURUR5 URRURXRXRURUR5 Mq g)NT)
r�r��listenr�r��_start_servingr�r�r�r�)r�r1s  rr��Server._start_serving8sl���=�=����
��M�M�D��K�K��
�
�&��J�J�%�%��&�&��.?�.?��m�m�T�%@�%@��*�*�
,�"r!c��UR$rP)r�r�s r�get_loop�Server.get_loopCs���z�z�r!c��UR$rP)r�r�s r�
is_serving�Server.is_servingFs���}�}�r!c�V�URcg[SUR55$)NrQc3�N# �UHn[R"U5v� M g7frP)r�TransportSocket)rR�ss  rrT�!Server.sockets.<locals>.<genexpr>Ms���F�
�1�V�+�+�A�.�.�
�s�#%)r��tupler�s rr��Server.socketsIs$���=�=� ���F��
�
�F�F�Fr!c�v�URnUcgSUlUHnURRU5 M  SUlURb@URR5(d!URR
5 SUl[UR5S:XaUR5 gg)NFr)
r�r��
_stop_servingr�r�r�r�r�r�r�)r�r�r1s   r�close�Server.closeOs����-�-���?����
��D��J�J�$�$�T�*����
��%�%�1��-�-�2�2�4�4��%�%�,�,�.�(,�D�%��t�}�}���"��L�L�N�#r!c�f�URR5HnUR5 M grP)r��copyr�r�s  r�
close_clients�Server.close_clientsb�#�����+�+�-�I��O�O��.r!c�f�URR5HnUR5 M grP)r�r��abortr�s  r�
abort_clients�Server.abort_clientsfr�r!c��l# �UR5 [R"S5IShv�N gN7fr�)r�r�sleepr�s r�
start_serving�Server.start_servingjs$��������k�k�!�n���s�*4�2�4c���# �URb[SU<S35eURc[SU<S35eUR5 URR5UlURIShv�N SUlgN
![Ra1 UR5 UR5IShv�N e!e=ff=f!SUlf=f7f)Nzserver z, is already being awaited on serve_forever()z
 is closed)
r�r�r�r�r�r�r�CancelledErrorr��wait_closedr�s r�
serve_forever�Server.serve_foreverps�����$�$�0���$��!M�N�P�
P��=�=� �����
�;�<�<�����$(�J�J�$<�$<�$>��!�		-��+�+�+�+�)-�D�%�
,���(�(�	�
��
�
���&�&�(�(�(�����	��)-�D�%�s`�A*C �-B�<B
�=B�C �
B�C�!#C�C�C�
C�C
�
C�C�	C�C c��# �URcgURR5nURRU5 UIShv�N gN7f)a�Wait until server is closed and all connections are dropped.

- If the server is not closed, wait.
- If it is closed, but there are still active connections, wait.

Anyone waiting here will be unblocked once both conditions
(server is closed and all connections have been dropped)
have become true, in either order.

Historical note: In 3.11 and before, this was broken, returning
immediately if the server was already closed, even if there
were still active connections. An attempted fix in 3.12.0 was
still broken, returning immediately if the server was still
open and there were no active connections. Hopefully in 3.12.1
we have it right.
N)r�r�r�rB)r�r�s  rr	�Server.wait_closed�s?���*�=�=� �����)�)�+���
�
���V�$����s�A	A�A�A)r�r�r�r�r�r�r�r�r�r�r�rP)r�r�r�r�r�r�r�r�r�r�r�r��propertyr�r�r�rrr
r	r�rQr!rrrse��>B�)� G�%��
(�	,����G��G�
�&���-�*r!rc�
�\rSrSrSrSrSrSSS.SjrSrS	r	S`SSS
.Sjjr
S`SSSSSSS
S.SjjrSaSjrSbSjr
SbSjrS`SjrSrSrSrSrSrSrSrS`SjrSrSrSrSrS rS!rS"rS#rS$r \!RD4S%jr#S&r$S'r%SS(.S)jr&SS(.S*jr'SS(.S+jr(S,r)S-r*S.r+SS(.S/jr,S0r-S1r.S2r/S3S3S3S3S4.S5jr0ScS6jr1SdS
S7.S8jjr2S9r3S:r4S;r5S`S<jr6SbSS3S3S3SSSSSSSSS=.S>jjr7SeS?jr8SdS
S7.S@jjr9SAr:SBr;SSSSSC.SDjr<SbS3S3S3SSSSE.SFjjr=S3\>R~S3S3S4.SGjr@SHrASb\>R�\>R�SSISSSSSSS
SJ.SKjjrDSSSSL.SMjrESNrFSOrGSPrH\IR�\IR�\IR�SS
S3SSSSQ.	SRjrK\IR�\IR�\IR�SSS3SSSSQ.	SSjrLSTrMSUrNSVrOSWrPSXrQSYrRSZrSS[rTS\rUS]rVS^rWS_rXg)fri�c���SUlSUlSUl[R"5Ul/UlSUlSUlSUl	[R"S5RUl
SUlUR[ R""55 SUlSUlSUlSUlSUlSUl[0R2"5UlSUlSUlg)NrF�	monotonicg�������?)�_timer_cancelled_count�_closed�	_stoppingrV�deque�_ready�
_scheduled�_default_executor�
_internal_fds�
_thread_id�time�get_clock_info�
resolution�_clock_resolution�_exception_handler�	set_debugr�_is_debug_mode�_old_agen_hooks�slow_callback_duration�_current_handle�
_task_factory�"_coroutine_origin_tracking_enabled�&_coroutine_origin_tracking_saved_depthr�r��
_asyncgens�_asyncgens_shutdown_called�_executor_shutdown_calledr�s rr��BaseEventLoop.__init__�s���&'��#�������!�'�'�)������!%���������!%�!4�!4�[�!A�!L�!L���"&������z�0�0�2�3�#���'*��#�#���!���27��/�6:��3�"�/�/�+���*/��'�).��&r!c	��SURRSUR5SUR5SUR	5S3	$)Nr�z	 running=z closed=z debug=r�)r�r��
is_running�	is_closed�	get_debugr�s rr��BaseEventLoop.__repr__�sP������'�'�(�	�$�/�/�2C�1D�E��n�n�&�'�w�t�~�~�/?�.@��
C�	
r!c�*�[R"US9$)z,Create a Future object attached to the loop.�r�)r�Futurer�s rr��BaseEventLoop.create_future�s���~�~�4�(�(r!N)�name�contextc��UR5 URc5[R"XX#S9nUR(a
URS	U$UcURX5nOURXUS9nURU5 U$)z4Schedule a coroutine object.

Return a task object.
)r�r5r6����r6)�
_check_closedr%rr�_source_traceback�set_name)r��coror5r6�tasks     r�create_task�BaseEventLoop.create_task�s���
	
�������%��:�:�d�D�J�D��%�%��*�*�2�.������)�)�$�5���)�)�$�g�)�F���M�M�$���r!c�L�Ub[U5(d[S5eXlg)aGSet a task factory that will be used by loop.create_task().

If factory is None the default task factory will be set.

If factory is a callable, it should have a signature matching
'(loop, coro)', where 'loop' will be a reference to the active
event loop, 'coro' will be a coroutine object.  The callable
must return a Future.
Nz'task factory must be a callable or None)�callabler>r%)r��factorys  r�set_task_factory�BaseEventLoop.set_task_factory�s&����x��'8�'8��E�F�F�$�r!c��UR$)z<Return a task factory, or None if the default one is in use.)r%r�s r�get_task_factory�BaseEventLoop.get_task_factory�s���!�!�!r!)�extra�serverc��[e)zCreate socket transport.��NotImplementedError)r�r1�protocolr�rIrJs      r�_make_socket_transport�$BaseEventLoop._make_socket_transport��
��"�!r!FT)�server_side�server_hostnamerIrJr�r��call_connection_madec��[e)zCreate SSL transport.rL)r��rawsockrN�
sslcontextr�rRrSrIrJr�r�rTs            r�_make_ssl_transport�!BaseEventLoop._make_ssl_transport�s
��"�!r!c��[e)zCreate datagram transport.rL)r�r1rN�addressr�rIs      r�_make_datagram_transport�&BaseEventLoop._make_datagram_transportrQr!c��[e)zCreate read pipe transport.rL�r��piperNr�rIs     r�_make_read_pipe_transport�'BaseEventLoop._make_read_pipe_transportrQr!c��[e)zCreate write pipe transport.rLr_s     r�_make_write_pipe_transport�(BaseEventLoop._make_write_pipe_transport
rQr!c	��# �[e7f)zCreate subprocess transport.rL)
r�rN�args�shell�stdin�stdout�stderr�bufsizerI�kwargss
          r�_make_subprocess_transport�(BaseEventLoop._make_subprocess_transports
���"�!�s�	c��[e)z�Write a byte to self-pipe, to wake up the event loop.

This may be called from a different thread.

The subclass is responsible for implementing the self-pipe.
rLr�s r�_write_to_self�BaseEventLoop._write_to_selfs
��"�!r!c��[e)zProcess selector events.rL)r��
event_lists  r�_process_events�BaseEventLoop._process_events!s��!�!r!c�<�UR(a[S5eg)NzEvent loop is closed)rr�r�s rr:�BaseEventLoop._check_closed%s���<�<��5�6�6�r!c�<�UR(a[S5eg)Nz!Executor shutdown has been called)r*r�r�s r�_check_default_executor�%BaseEventLoop._check_default_executor)s���)�)��B�C�C�*r!c��URRU5 UR5(d+URURUR55 ggrP)r(r�r.�call_soon_threadsafer?�aclose�r��agens  r�_asyncgen_finalizer_hook�&BaseEventLoop._asyncgen_finalizer_hook-sB��������%��~�~����%�%�d�&6�&6����
�F� r!c��UR(a[R"SU<S3[US9 URRU5 g)Nzasynchronous generator z3 was scheduled after loop.shutdown_asyncgens() call��source)r)�warnings�warn�ResourceWarningr(r�rs  r�_asyncgen_firstiter_hook�&BaseEventLoop._asyncgen_firstiter_hook2sA���*�*��M�M�)�$��21�2���
.�
	
�����D�!r!c��# �SUl[UR5(dg[UR5nURR	5 [
R"UVs/sHo"R5PM snSS06IShv�Nn[X15H5upE[U[5(dMURSU<3UUS.5 M7 gs snfNN7f)z,Shutdown all active asynchronous generators.TN�return_exceptionsz;an error occurred during closing of asynchronous generator )�messagerh�asyncgen)r)r�r(rX�clearr�gatherr~�zipr�	Exception�call_exception_handler)r��
closing_agens�ag�results�resultr�s      r�shutdown_asyncgens� BaseEventLoop.shutdown_asyncgens;s����*.��'��4�?�?�#�#�
��T�_�_�-�
����������$1�
2�M�b�i�i�k�M�
2�$�"�$�$�� ��7�L�F��&�)�,�,��+�+�"9�9=�� B�!'� $�	-��8��3�$�s$�A&C�(C�
C�C�'C�7$Cc��# �SUlURcgUR5n[R"UR
U4S9nUR
5 [R"U5IShv�N UIShv�N SSS5IShv�N UR5 gN/N'N!,IShv�N(df   N.=f![a: [R"SUS3[SS9 URRSS	9 gf=f7f)
z�Schedule the shutdown of the default executor.

The timeout parameter specifies the amount of time the executor will
be given to finish joining. The default value is None, which means
that the executor will be given an unlimited amount of time.
TN)�targetrgz:The executor did not finishing joining its threads within z	 seconds.�)�
stacklevelF��wait)r*rr��	threading�Thread�_do_shutdown�startr
�timeout�join�TimeoutErrorr�r��RuntimeWarning�shutdown)r�r��future�threads    r�shutdown_default_executor�'BaseEventLoop.shutdown_default_executorTs����*.��&��!�!�)���#�#�%���!�!��):�):�&��K������		��'�'��0�0����1�0�
�K�K�M�1��1�0�0�0���	8��M�M�0�07�y�	�C�(�Q�
8�
�"�"�+�+��+�7�		8�s��AD
�C�3B#�4C�7B)�=B%�>B)�C�
B'�C�D
�#C�%B)�'C�)C�/B2�0C�<C�AD�D
�D�D
c�t�URRSS9 UR5(d"UR[R
US5 gg![aZnUR5(d;UR5(d!URURU5 SnAgSnAgSnAgSnAff=f)NTr�)	rr�r.r}r�_set_result_unless_cancelledr�rgr�)r�r��exs   rr��BaseEventLoop._do_shutdownls���	D��"�"�+�+��+�6��>�>�#�#��)�)�'�*N�*N�*0�$�8�$���	D��>�>�#�#�F�,<�,<�,>�,>��)�)�&�*>�*>��C�C�-?�#��	D�s�AA�
B7�AB2�2B7c��UR5(a[S5e[R"5b[S5eg)Nz"This event loop is already runningz7Cannot run the event loop while another loop is running)r-r�r�_get_running_loopr�s r�_check_running�BaseEventLoop._check_runningvsA���?�?����C�D�D��#�#�%�1��I�K�
K�2r!c�`�UR5 UR5 URUR5 [R
"5Ul[R"5Ul	[R"URURS9 [R"U5 g)z�Prepare the run loop to process events.

This method exists so that custom custom event loop subclasses (e.g., event loops
that integrate a GUI event loop with Python's event loop) have access to all the
loop setup logic.
)�	firstiter�	finalizerN)r:r��_set_coroutine_origin_tracking�_debug�sys�get_asyncgen_hooksr"r��	get_identr�set_asyncgen_hooksr�r�r�_set_running_loopr�s r�_run_forever_setup� BaseEventLoop._run_forever_setup}s��	
���������+�+�D�K�K�8�"�5�5�7���#�-�-�/�������3�3��3�3�	
�
	� � ��&r!c���SUlSUl[R"S5 UR	S5 UR
b%[R"UR
6 SUlgg)z�Clean up after an event loop finishes the looping over events.

This method exists so that custom custom event loop subclasses (e.g., event loops
that integrate a GUI event loop with Python's event loop) have access to all the
loop cleanup logic.
FN)rrrr�r�r"r�r�r�s r�_run_forever_cleanup�"BaseEventLoop._run_forever_cleanup�s[��������� � ��&��+�+�E�2����+��"�"�D�$8�$8�9�#'�D� �,r!c��UR5 UR5 UR(aOM$UR5 g!UR5 f=f)zRun until stop() is called.N)r��	_run_oncerr�r�s r�run_forever�BaseEventLoop.run_forever�sJ��	(��#�#�%����� ��>�>���

�%�%�'��D�%�%�'�s�5A�Ac�V�UR5 UR5 [R"U5(+n[R
"XS9nU(aSUlUR[5 UR5 UR[5 UR5(d[S5eUR5$! U(a:UR5(a%UR5(dUR5 e=f!UR[5 f=f)a,Run until the Future is done.

If the argument is a coroutine, it is wrapped in a Task.

WARNING: It would be disastrous to call run_until_complete()
with the same coroutine twice -- it would wrap it in two
different Tasks and that can't be good.

Return the Future's result, or raise its exception.
r2Fz+Event loop stopped before Future completed.)r:r�r�isfuturer�
ensure_future�_log_destroy_pending�add_done_callbackror�r�rgrh�remove_done_callbackr�r�)r�r��new_tasks   r�run_until_complete� BaseEventLoop.run_until_complete�s���	
���������'�'��/�/���$�$�V�7���+0�F�'�� � �!7�8�
	@�����
�'�'�(>�?��{�{�}�}��L�M�M��}�}����	��F�K�K�M�M�&�2B�2B�2D�2D�� � �"����'�'�(>�?�s�4C
�
AD�D�D(c��SUlg)z�Stop running the event loop.

Every callback already scheduled will still run.  This simply informs
run_forever to stop looping after a complete iteration.
TN)rr�s rrl�BaseEventLoop.stop�s����r!c��UR5(a[S5eUR(agUR(a[R
"SU5 SUlURR5 URR5 SUl	URnUbSUl
URSS9 gg)z�Close the event loop.

This clears the queues and shuts down the executor,
but does not wait for the executor to finish.

The event loop must not be running.
z!Cannot close a running event loopNzClose %rTFr�)r-r�rr�r�debugrr�rr*rr��r��executors  rr��BaseEventLoop.close�s����?�?����B�C�C��<�<���;�;��L�L��T�*����������������)-��&��)�)����%)�D�"����5��)� r!c��UR$)z*Returns True if the event loop was closed.)rr�s rr.�BaseEventLoop.is_closed�s���|�|�r!c��UR5(d7U"SU<3[US9 UR5(dUR5 ggg)Nzunclosed event loop r�)r.r�r-r�)r��_warns  r�__del__�BaseEventLoop.__del__�sC���~�~����(���1�?�4�P��?�?�$�$��
�
��%� r!c��URSL$)z*Returns True if the event loop is running.N)rr�s rr-�BaseEventLoop.is_running�s�����t�+�,r!c�,�[R"5$)z�Return the time according to the event loop's clock.

This is a float expressed in seconds since an epoch, but the
epoch, precision, accuracy and drift are unspecified and may
differ per event loop.
)rrr�s rr�BaseEventLoop.time�s���~�~��r!r9c��Uc[S5eUR"UR5U-U/UQ7SU06nUR(a
URS	U$)a�Arrange for a callback to be called at a given time.

Return a Handle: an opaque object with a cancel() method that
can be used to cancel the call.

The delay can be an int or float, expressed in seconds.  It is
always relative to the current time.

Each callback will be called exactly once.  If two callbacks
are scheduled for exactly the same time, it is undefined which
will be called first.

Any positional arguments after the callback will be passed to
the callback when it is called.
zdelay must not be Noner6r8)r>�call_atrr;)r��delay�callbackr6rg�timers      r�
call_later�BaseEventLoop.call_laters]�� �=��4�5�5����T�Y�Y�[�5�0�(�.�T�.�%,�.���"�"��'�'��+��r!c�d�Uc[S5eUR5 UR(a"UR5 UR	US5 [
R"XX@U5nUR(a
URS	[R"URU5 SUl
U$)zlLike call_later(), but uses an absolute time.

Absolute time corresponds to the event loop's time() method.
zwhen cannot be Noner�r8T)r>r:r��
_check_thread�_check_callbackr�TimerHandler;�heapq�heappushr)r��whenr�r6rgr�s      rr��BaseEventLoop.call_at s���
�<��1�2�2������;�;���� �� � ��9�5��"�"�4�4�w�G���"�"��'�'��+�
���t����.�����r!c���UR5 UR(a"UR5 URUS5 UR	XU5nUR
(a
UR
S	U$)a$Arrange for a callback to be called as soon as possible.

This operates as a FIFO queue: callbacks are called in the
order in which they are registered.  Each callback will be
called exactly once.

Any positional arguments after the callback will be passed to
the callback when it is called.
�	call_soonr8)r:r�r�r��
_call_soonr;�r�r�r6rgrs     rr��BaseEventLoop.call_soon2s_��	
�����;�;���� �� � ��;�7������9���#�#��(�(��,��
r!c���[R"U5(d"U5(a[SUS35e[	U5(d[SUSU<35eg)Nzcoroutines cannot be used with z()z"a callable object was expected by z(), got )r�iscoroutine�iscoroutinefunctionr>rB)r�r��methods   rr��BaseEventLoop._check_callbackEsp���"�"�8�,�,��.�.�x�8�8��1�&���<�>�
>���!�!��4�V�H�=��l�$�%�
%�"r!c��[R"XX5nUR(a
URS	URR	U5 U$)Nr8)r�Handler;rrB)r�r�rgr6rs     rr��BaseEventLoop._call_soonOs@�����x�t�=���#�#��(�(��,������6�"��
r!c�~�URcg[R"5nXR:wa[S5eg)aGCheck that the current thread is the thread running the event loop.

Non-thread-safe methods of this class make this assumption and will
likely behave incorrectly when the assumption is violated.

Should only be called when (self._debug == True).  The caller is
responsible for checking this condition for performance reasons.
NzMNon-thread-safe operation invoked on an event loop other than the current one)rr�r�r�)r��	thread_ids  rr��BaseEventLoop._check_threadVs@���?�?�"���'�'�)�	����'��'�(�
(�(r!c���UR5 UR(aURUS5 URXU5nUR(a
URS	UR5 U$)z"Like call_soon(), but thread-safe.r}r8)r:r�r�r�r;rqr�s     rr}�"BaseEventLoop.call_soon_threadsafegs^�������;�;�� � ��+A�B������9���#�#��(�(��,������
r!c�>�UR5 UR(aURUS5 UcBURnUR	5 Uc#[
RRSS9nXl[R"UR"U/UQ76US9$)N�run_in_executor�asyncio)�thread_name_prefixr2)
r:r�r�rrz�
concurrentr�ThreadPoolExecutor�wrap_future�submit)r�r��funcrgs    rr�BaseEventLoop.run_in_executorrs��������;�;�� � ��'8�9����-�-�H��(�(�*���%�-�-�@�@�'0�A���*2�&��"�"��O�O�D�(�4�(�t�5�	5r!c�x�[U[RR5(d[	S5eXlg)Nz,executor must be ThreadPoolExecutor instance)rrrrr>rr�s  r�set_default_executor�"BaseEventLoop.set_default_executor�s-���(�J�$6�$6�$I�$I�J�J��J�K�K�!)�r!c�X�USU<3/nU(aURSU<35 U(aURSU<35 U(aURSU<35 U(aURSU<35 SRU5n[R"SU5 UR	5n[
R"XX4XV5n	UR	5U-
n
SUS	U
S
-SSU	<3nX�R:�a[R"U5 U	$[R"U5 U	$)
N�:zfamily=ztype=zproto=zflags=�, zGet address info %szGetting address info z took g@�@z.3fzms: )	rBr�rr�rr+�getaddrinfor#�info)r�rDrErFrGrH�flags�msg�t0�addrinfo�dts           r�_getaddrinfo_debug� BaseEventLoop._getaddrinfo_debug�s����q���!�"����J�J���
�+�,���J�J��t�h�'�(���J�J���y�)�*���J�J���y�)�*��i�i��n�����*�C�0�
�Y�Y�[���%�%�d�&��M��
�Y�Y�[�2�
��%�c�U�&��c��#��d�8�,�O��
�,�,�,��K�K�����
�L�L����r!r�rFrGrHrc
��# �UR(a
URnO[RnUR	SXqX#XEU5IShv�N$N7frP)r�rr+rr)r�rDrErFrGrHr�getaddr_funcs        rr�BaseEventLoop.getaddrinfo�sN����;�;��2�2�L�!�-�-�L��)�)��,�d�D��H�H�	H�H�s�AA�	A�
Ac��`# �URS[RX5IShv�N$N7frP)rr+�getnameinfo)r��sockaddrrs   rr!�BaseEventLoop.getnameinfo�s/����)�)��&�$�$�h�7�7�	7�7�s�%.�,�.)�fallbackc��f# �UR(aUR5S:wa[S5e[U5 UR	XX45 URXX45IShv�N$N![RanU(deSnAOSnAff=fURXX45IShv�N$7f)Nrzthe socket must be non-blocking)	r��
gettimeoutr,rw�_check_sendfile_params�_sock_sendfile_nativer�SendfileNotAvailableError�_sock_sendfile_fallback)r�r1�file�offset�countr$rns       r�
sock_sendfile�BaseEventLoop.sock_sendfile�s�����;�;�4�?�?�,��1��>�?�?��$���#�#�D��>�	��3�3�D�4:�C�C�
C�C���3�3�	�����	���1�1�$�28�A�A�A�	A�sN�AB1�A-�&A+�'A-�*B1�+A-�-B�B�	B1�B�B1�+B.�,B1c��H# �[R"SU<SU<S35e7f)Nz-syscall sendfile is not available for socket z
 and file z combination�rr)�r�r1r+r,r-s     rr(�#BaseEventLoop._sock_sendfile_native�s3����2�2�;�D�8�D��x�|�
-�.�	.�s� "c��r# �U(aURU5 U(a[U[R5O[Rn[	U5nSnU(a[XG-
U5nUS::aO][U5SUnUR
SURU5IShv�Nn	U	(dO"URXSU	5IShv�N Xy-
nMyUUS:�a&[US5(aURX7-5 $$$N\N:!US:�a&[US5(aURX7-5 fff=f7f)Nr�seek)
r5�minr�!SENDFILE_FALLBACK_READBUFFER_SIZE�	bytearray�
memoryviewr�readinto�sock_sendallr*)
r�r1r+r,r-�	blocksize�buf�
total_sent�view�reads
          rr*�%BaseEventLoop._sock_sendfile_fallback�s+�����I�I�f���
��y�B�B�C�#�E�E�	��	�"���
�	/��� #�E�$6�	� B�I� �A�~��!�#��z�	�2��!�1�1�$��
�
�t�L�L�����'�'��5�D�k�:�:�:��"�
����A�~�'�$��"7�"7��	�	�&�-�.�#8�~�M�;���A�~�'�$��"7�"7��	�	�&�-�.�#8�~�sC�AD7�AD�%D�&#D�	D�
D�-D7�D�D�.D4�4D7c���S[USS5;a[S5eUR[R:Xd[S5eUbO[U[5(d[SRU55eUS::a[SRU55e[U[5(d[SRU55eUS:a[SRU55eg)N�b�modez$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})rz0offset must be a non-negative integer (got {!r}))	rr,rGr+r:rr=r>�formatr2s     rr'�$BaseEventLoop._check_sendfile_params�s����g�d�F�C�0�0��C�D�D��y�y�F�.�.�.��J�K�K����e�S�)�)��A�H�H��O�Q�Q���z� �A�H�H��O�Q�Q��&�#�&�&��B�I�I����
��A�:��B�I�I����
�r!c���# �/nUR"U5 UupVpxn	Sn
[R"XVUS9n
U
RS5 UbNUH!un  p�X�:waMU
RU5  O) U(aUR5e[	SU<S35eURX�5IShv�N U
S=p$![aRn
SU<S[U
5R
53n[	U
RU5n
URU
5 Sn
A
M�Sn
A
ff=fNh![a*n
URU
5 U
bU
R5 eSn
A
f U
bU
R5 e=f!S=pf=f7f)z$Create, bind and connect one socket.N�rFrGrHF�*error while attempting to bind on address �: z&no matching local address with family=z found)rBr+�setblocking�bindr/r�lower�errno�pop�sock_connectr�)r�r�	addr_info�local_addr_infos�
my_exceptionsrF�type_rH�_r[r1�lfamily�laddrrnrs               r�
_connect_sock�BaseEventLoop._connect_sock�s}����
����-�(�+4�(��u����#	.��=�=��%�H�D����U�#��+�/?�+�G�Q��1��(� �	2��	�	�%�(��
0@�%�+�/�/�1�1�%�(O��y�PV�&W�X�X��#�#�D�2�2�2��*.�-�J���1#�2�'�',�i�r�#�c�(�.�.�2B�1C�E��&�c�i�i��5��%�,�,�S�1�1��
2��
3���	�� � ��%����
�
����	����
�
����)-�-�J��sk�E)�:D�B5�,?D�+D�,D�1E)�5
D�?AD�D�D�D�
E� %E�E�E!�!E&�&E))rurFrHrr1�
local_addrrSr�r��happy_eyeballs_delay�
interleave�
all_errorsc	���^^^^# �U
bU(d[S5eU
cU(aU(d[S5eUn
UbU(d[S5eUbU(d[S5eUb[U5 U
bUcSnUcUGb�Ub[S5eTRX#4U[RXgTS9IShv�NnU(d[S	5eU	b<TRX�[RUUTS9IShv�NmT(d[S	5eOSmU(a[
UU5n/mU
c&UHnTRTUT5IShv�Nn O0 O-[R"UUU4S
jU5U
TS9IShv�NSnUc�TVVs/sHnUHnUPM M snnmU(a[S
T5e[T5S:XaTSe[TS5m[U4SjT55(aTSe[SRSRST5555eO;Uc[S5eUR [R:wa[SU<35eTR#X�XJUUS9IShv�NunnTR$(a+UR'S5n[(R*"SX�UUU5 UU4$GNGN�GN}![
a GM�f=fGNcs snnf!Smf=fNr7f)a�Connect to a TCP server.

Create a streaming transport connection to a given internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.

This method is a coroutine which will try to establish the connection
in the background.  When successful, the coroutine returns a
(transport, protocol) pair.
Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a host�1ssl_handshake_timeout is only meaningful with ssl�0ssl_shutdown_timeout is only meaningful with sslr�8host/port and sock can not be specified at the same time�rFrGrHrr��!getaddrinfo() returned empty listc3�:># �UHnU4UUU4Sjjv� M g7f)c�*>�TRTUT5$rP)rX)rr�laddr_infosr�s ���r�<lambda>�;BaseEventLoop.create_connection.<locals>.<genexpr>.<lambda>zs���$�2D�2D�&��+�3r!NrQ)rRrrrfr�s  ���rrT�2BaseEventLoop.create_connection.<locals>.<genexpr>ws&�����).�H�)1���).�s�r2rzcreate_connection failedc3�@># �UHn[U5T:Hv� M g7frP�r)rRrn�models  �rrTri�s����G�J�S�s�3�x�5�0�J�s�zMultiple exceptions: {}rc3�8# �UHn[U5v� M g7frPrk)rRrns  rrTri�s���%E�*�3�c�#�h�h�*�s�z5host and port was not specified and no sock specified�"A Stream Socket was expected, got )r�r�r+z%r connected to %s:%r: (%r, %r))r,rw�_ensure_resolvedr+r:r/rerXr�staggered_race�ExceptionGroupr�r�allrEr�rG�_create_connection_transportr��get_extra_inforr�)r�r�rDrErurFrHrr1rZrSr�r�r[r\r]�infosr�subrnr�rNrrfrls`                     @@@r�create_connection�BaseEventLoop.create_connectionsp����(�&�s��J�K�K��"�s�� �"A�B�B�"�O� �,�S��C�E�
E� �+�C��B�D�
D����d�#��+�
�0B��J���t�/��� �N�P�P��/�/���V��'�'�u��0�N�N�E���A�B�B��%�$(�$9�$9���+�+�5��d�%:�%,�,��#�!�"E�F�F�#�#���-�e�Z�@���J�#�+� %�H�!�%)�%7�%7�&��+�&?� ?���	!&�(�6�6��).�
�)��������|�-7�G�Z�c�3�C�c�3�c�Z�G�
�&�!�,�-G��T�T��:��!�+�(��m�+�!$�J�q�M� 2���G�J�G�G�G�",�Q�-�/�&�&?�&F�&F� �I�I�%E�*�%E�E�'G�H�H��(�|� �K�M�M��y�y�F�.�.�.�!�8���A�C�C�%)�$E�$E��C�"7�!5�%F�%7�7��	�8��;�;��+�+�H�5�D��L�L�:��T�9�h�
@��(�"�"�mN�,�" ?��#�!� �!����H�� "&�J�� 7�s��B.K$�4J7�5=K$�2J:�36K$�*K�J=�K�*K$�/K�0K$�?K�K$�BK�AK$�/K"�0AK$�:K$�=K�
K�
K$�K�K$�K$�K�K$c��2# �URS5 U"5nUR5n	U(a-[U[5(aSOUn
UR	XX�XTUUS9nOURXU	5nU	IShv�N X�4$N! UR
5 e=f7f)NF�rRrSr�r�)rKr�r�boolrXrOr�)r�r1r�rurSrRr�r�rNr�rWr�s            rrs�*BaseEventLoop._create_connection_transport�s����	
�����#�%���#�#�%���!+�C��!6�!6��C�J��0�0��
�'�&;�%9�	1�;�I��3�3�D�F�K�I�	��L�L�
�"�"�
��	��O�O���s0�A/B�2B�7A?�8B�<B�?B�B�Bc��# �UR5(a[S5e[US[RR
5nU[RR
La[SU<35eU[RRLaURXX45IShv�N$U(d[SU<35eURXX45IShv�N$N4![RanU(deSnANSSnAff=fN/7f)aSend a file to transport.

Return the total number of bytes which were sent.

The method uses high-performance os.sendfile if available.

file must be a regular file object opened in binary mode.

offset tells from where to start reading the file. If specified,
count is the total number of bytes to transmit as opposed to
sending the file until EOF is reached. File position is updated on
return or also in case of error in which case file.tell()
can be used to figure out the number of bytes
which were sent.

fallback set to True makes asyncio to manually read and send
the file when the platform does not support the sendfile syscall
(e.g. Windows or SSL socket on Unix).

Raise SendfileNotAvailableError if the system does not support
sendfile syscall and fallback is False.
zTransport is closing�_sendfile_compatiblez(sendfile is not supported for transport NzHfallback is disabled and native sendfile is not supported for transport )r�r�rr�
_SendfileMode�UNSUPPORTED�
TRY_NATIVE�_sendfile_nativerr)�_sendfile_fallback)r�r�r+r,r-r$rDrns        r�sendfile�BaseEventLoop.sendfile�s���0���!�!��5�6�6��y�"8� �.�.�:�:�<���9�*�*�6�6�6��:�9�-�H�J�
J��9�*�*�5�5�5�
�!�2�2�9�39�B�B�B���+�+4�-�9�:�
:��,�,�Y�-3�<�<�	<�B���7�7�
��� ��
��<�sN�BD	�C�'C�(C�+,D	�D�D	�C�D�2C?�:D	�?D�D	c��6# �[R"S5e7f)Nz!sendfile syscall is not supportedr1)r�r�r+r,r-s     rr��BaseEventLoop._sendfile_native�s����2�2�/�1�	1�s�c��X# �U(aURU5 U(a[US5OSn[U5nSn[U5nU(aX[XG-
U5nUS::aDUUS:�a$[	US5(aURX7-5 UR5IShv�N $[
U5SUn	URSURU	5IShv�Nn
U
(dDUUS:�a$[	US5(aURX7-5 UR5IShv�N $UR5IShv�N URU	SU
5 Xz-
nGMN�N�N<N%!US:�a$[	US5(aURX7-5 UR5IShv�N f=f7f)Ni@rr5)r5r6r8ryr*r�r9rr:r��write)r�r�r+r,r-r<r=r>rHr?r@s           rr�� BaseEventLoop._sendfile_fallback�ss�����I�I�f��).�C��u�%�E�	��	�"���
�)�&�1��	"��� #�E�$6�	� B�I� �A�~�)��A�~�'�$��"7�"7��	�	�&�-�.��-�-�/�!�!�"�#��z�	�2��!�1�1�$��
�
�t�L�L���%�
�A�~�'�$��"7�"7��	�	�&�-�.��-�-�/�!�!�
�k�k�m�#�#����T�%�4�[�)��"�
��
"�M�
"�
$���A�~�'�$��"7�"7��	�	�&�-�.��-�-�/�!�!�s��AF*�	E"�&=F*�#E�$F*�).E"�E�E"�$=F*�!E�"F*�'E"�:E �;E"�F*�E"�F*� E"�">F'� F#�!F'�'F*rzc��# �[c[S5e[U[R5(d[	SU<35e[USS5(d[	SU<S35eUR
5n[R"XX8XEUUSS9	n	UR5 URU	5 URU	RU5n
URUR5nUIShv�N U	R"$N![a2 UR5 U
R!5 UR!5 ef=f7f)	zbUpgrade transport to TLS.

Return a new transport that *protocol* should start using
immediately.
Nz"Python ssl module is not availablez@sslcontext is expected to be an instance of ssl.SSLContext, got �_start_tls_compatibleFz
transport z  is not supported by start_tls())r�r�rT)rur�r�
SSLContextr>rr�r
�SSLProtocolr�r�r�r�r��
BaseExceptionr�r��_app_transport)r�r�rNrWrRrSr�r�r��ssl_protocol�
conmade_cb�	resume_cbs            r�	start_tls�BaseEventLoop.start_tlss<����;��C�D�D��*�c�n�n�5�5���!�n�&�'�
'��y�"9�5�A�A���Y�M�)I�J�L�
L��#�#�%���+�+��J��"7�!5�!&�(��	���!����|�,��^�^�L�$@�$@�)�L�
��N�N�9�#;�#;�<�	�	��L�L��*�*�*�
���	��O�O�����������		�s0�C$D>�'C?�,C=�-C?�1D>�=C?�?<D;�;D>)rFrHr�
reuse_port�allow_broadcastr1c
��n	# �U	b�U	R[R:Xa[SU	<35eU(d*U(d#U(dU(dU(dU(dU(aB[	X#XEUUUS9n
SRSU
R
555n[SUS35eU	RS5 SnGO�U(d U(dUS	:Xa[S
5eXE4S44n
GO�[[S5(a�U[R:Xa�X#4H(nUcM[U[5(aM[S
5e U(aYUS	S;aP[R"[R"U5R 5(a[R""U5 XE4X#444n
GO0nS	U4SU44H�unnUcM[U[,5(a[/U5S:Xd[S5eUR1X�[R2XVUS9IShv�NnU(d['S5eUH"unnnnnUU4nUU;aSS/UU'UUUU'M$ M� UR
5VVs/sH(unnU(aUS	cMU(aUScM$UU4PM* n
nnU
(d[S5e/nU
H�uupEunnSn	Sn[R"U[R2US9n	U(a[5U	5 U(a/U	R7[R8[R:S5 U	RS5 U(aU	R=U5 U(a#U(dUR?U	U5IShv�N Un O US	eU"5nURE5nURGU	UUU5nURH(a:U(a[(RJ"SX#UU5 O[(RL"SUUU5 UIShv�N UU4$![$a GNx[&a"n[(R*"SX/5 SnAGN�SnAff=fGN6s snnfN�![&a1nU	bU	RA5 URB"U5 SnAGM�SnAf U	bU	RA5 e=fN�! URA5 e=f7f)zCreate datagram connection.Nz$A datagram socket was expected, got )rZ�remote_addrrFrHrr�r�rc3�F# �UHupU(dMUSU3v� M g7f)�=NrQ)rR�k�vs   rrT�9BaseEventLoop.create_datagram_endpoint.<locals>.<genexpr>Zs ���$N�L�D�A�A�Z��s�!�A�3�Z�L�s�
!�!zKsocket modifier keyword arguments can not be used when sock is specified. (�)Frzunexpected address family�NN�AF_UNIXzstring is expected)r�z2Unable to check or remove stale UNIX socket %r: %rrr�z2-tuple is expectedrbrczcan not get address informationrHz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))'rGr+r:r,�dictr��itemsrKr*r�rrr>�stat�S_ISSOCK�os�st_mode�remove�FileNotFoundErrorr/r�errorr�r�ror;r2r-r.�SO_BROADCASTrLrPr�rBr�r\r�rr�) r�r�rZr�rFrHrr�r�r1�opts�problems�r_addr�addr_pairs_inforb�err�
addr_infos�idxru�famrU�pror[�key�	addr_pairr�
local_address�remote_addressrnrNr�r�s                                 r�create_datagram_endpoint�&BaseEventLoop.create_datagram_endpointHs�������y�y�F�.�.�.� �:�4�(�C�E�E��k��e�u��/��z�#)�e�'1�,;�=�� �9�9�$N�D�J�J�L�$N�N�� �0�08�z��<�=�=�
���U�#��F��+��Q�;�$�%@�A�A�%+�O�\�#B�"D�����+�+��&�.�.�0H�'�5�D��'�
�4��0E�0E�'�(<�=�=�6��*�Q�-�{�"B�	6��=�=�����)<�)D�)D�E�E��I�I�j�1�&,�O�%/�$=�$?�#B�� �
�#$�j�/�A�{�3C�!D�I�C���'� *�4�� 7� 7�C��I��N�"+�,A�"B�B�&*�&;�&;� �f�6G�6G�"'�4�'<�'A�!A�� %�")�*M�"N�N�7<�3�C��C��G�#&��*�C�"�*�4�37��,�
�3��3:�J�s�O�C�0�	8=�"E�&<F�;K�;K�;M�#E�;M���i�'�I�a�L�%�(�Y�q�\�%�S�)�$�;M� �#E�
'�$�%F�G�G��J�6E�2��&�0�-�������!�=�=�%�F�,=�,=�U�L�D�!�&�t�,�&����"�-�-�v�/B�/B�A�G��$�$�U�+�!��	�	�-�0�"�.�"&�"3�"3�D�.�"I�I�I�!/���96E�<!��m�#�#�%���#�#�%���1�1��(�F�F�,�	��;�;�����0�&�Y��J����(�(�)�X�?�	��L�L�
�(�"�"��}-���"�6����&5�%/�6�6��6�� !A��#E�8J���+��'��
�
���%�%�c�*�*����'��
�
����*
��	��O�O���s��DR5�R5�-R5�AP�R5�8AR5�
Q�AR5� Q�8Q�Q�(R5�8B8Q�0Q	�1Q�7A?R5�7R�<R�=R�R5�
P=�R5�	P=�P8�2R5�8P=�=R5�R5�	Q�
R�%R�:R5�R�R5�R�R2�2R5c	��|# �USSupx[XxX#U/USSQ76n	U	bU	/$URXxX#XES9IShv�N$N7f)Nr�r)rMr)
r�r[rFrGrHrr�rDrErs
          rro�BaseEventLoop._ensure_resolved�sg����R�a�[�
���D��e�J�g�a�b�k�J�����6�M��)�)�$�V�05�*�D�D�
D�D�s�3<�:�<c��# �URX4U[RX@S9IShv�NnU(d[SU<S35eU$N7f)N)rFrGrr�zgetaddrinfo(z) returned empty list)ror+r:r/)r�rDrErFrrus      r�_create_server_getaddrinfo�(BaseEventLoop._create_server_getaddrinfo�sX����+�+�T�L��17�1C�1C�27�,�D�D����L���0E�F�G�G���D�s�%A�A�Ar)rFrr1r�ru�
reuse_addressr��
keep_aliver�r�rc
��	# �[U[5(a[S5eUbUc[S5eU
bUc[S5eUb[	U5 UcUGbrUb[S5eU	c-[
RS:H=(a [RS:gn	/nUS:XaS/nOD[U[5(d)[U[RR5(dU/nOUnUVs/sHnURX#UUS	9PM nn[R"U6IShv�Nn[!["R$R'U55nS
nUGH)nUunnnnn[(R("UUU5nUR3U5 U	(a/UR5[(R6[(R8S5 U
(a[;U5 U(a/UR5[(R6[(R<S5 [>(aXU[(R@:XaD[C[(S5(a/UR5[(RD[(RFS5 URIU5 GM, U(d#[KSUVs/sHnUSPM
 sn<35eSnU(dUHnURU5 M O>Uc[S5eURV[(RX:wa[SU<35eU/nUHnUR[S
5 M []XUX�UU
5nU(a.UR_5 [R`"S5IShv�N UR,(a[.Rb"SU5 U$s snfGNx![(R*a. UR,(a[.R0"SUUUSS
9 GM�f=f![Ja�nSU<S[U5RM5<3nURN[NRP:XaNURS5 URU5 UR,(a[.R0"U5 SnAGM%[KURNU5SeSnAff=fs snf!U(dUHnURU5 M ff=fGN]7f)a�Create a TCP server.

The host parameter can be a string, in that case the TCP server is
bound to host and port.

The host parameter can also be a sequence of strings and in that case
the TCP server is bound to all hosts of the sequence. If a host
appears multiple times (possibly indirectly e.g. when hostnames
resolve to the same IP address), the server is only bound once to that
host.

Return a Server object which can be used to stop the service.

This method is a coroutine.
z*ssl argument must be an SSLContext or NoneNr_r`ra�posix�cygwinr5)rFrFz:create_server() failed to create socket.socket(%r, %r, %r)T��exc_info�IPPROTO_IPV6rIrJz%could not bind on any address out of �z)Neither host/port nor sock were specifiedrnrz
%r is serving)2rr{r>r,rwr�r5r��platformrrV�abc�Iterabler�rr��setr[r\r]r+r�r�r�warningrBr-r.�SO_REUSEADDRr2�SO_KEEPALIVErArr*r��IPV6_V6ONLYrLr/rMrN�
EADDRNOTAVAILrOr�rGr:rKrr�rr)r�r�rDrErFrr1r�rur�r�r�r�r�rr��hosts�fsru�	completed�resrL�socktyperH�	canonname�sar�rrrJs                              r�
create_server�BaseEventLoop.create_server�s.���:�c�4� � ��H�I�I� �,����C�E�
E� �+����B�D�
D����d�#���t�/��� �N�P�P��$� "���7� 2� O�s�|�|�x�7O�
��G��r�z�����T�3�'�'� ��{���'?�'?�@�@������$�%�#�d��1�1�$�V�8=�2�?�#�
�%� �,�,��+�+�E��	���5�5�e�<�=�E��I�5
%� �C�9<�6�B��%��B�!�%�}�}�R��5�A���N�N�4�(�$����"�-�-�v�/B�/B�D�J�!�&�t�,�!����"�-�-�v�/B�/B�D�J�
"�	��&�/�/�1�#�F�N�;�;�����(;�(;�(.�(:�(:�(,�.�
@��	�	�"�
�=!�X�!�:?�%@�%�$�d�1�g�%�%@�#C�D�D�!�	� � '���
�
��!(���|� �!L�M�M��y�y�F�.�.�.� �#E�d�X�!N�O�O��f�G��D����U�#����'7��&;�,�.����!�!�#��+�+�a�.� � ��;�;��K�K���0��
��e%�,��"�<�<�!��;�;�"�N�N�,G�+-�x���O�!�
!��6#�@�#%�c�#�h�n�n�&6� 8���9�9��(;�(;�;�#�K�K�M� �J�J�L�#�{�{� &���s� 3�$�%�c�i�i��5�4�?��@��&A��!� '���
�
��!(�!��(
!�s��C*S�,N�S�N� .S�R�N�6C2R�)O�:R�R
�R�+B8S�#S�$4S�=O�R�O�R�
R�)BR
�/R�6R
�
R�R�#R=�=S)rur�r�c
��# �UR[R:wa[SU<35eUbU(d[S5eUbU(d[S5eUb[	U5 URX!USSUUS9IShv�NupgUR(a)URS5n[R"SX&U5 Xg4$NC7f)	Nrnr_r`r5T)rRr�r�r+z%r handled: (%r, %r))
rGr+r:r,rwrsr�rtrr�)r�r�r1rur�r�r�rNs        r�connect_accepted_socket�%BaseEventLoop.connect_accepted_socketqs����
�9�9��*�*�*��A�$��J�K�K� �,�S��C�E�
E� �+�C��B�D�
D����d�#�$(�$E�$E��C���"7�!5�%F�%7�7��	��;�;��+�+�H�5�D��L�L�/��(�K��"�"�7�s�A=C�?C�ACc��# �U"5nUR5nURX#U5nUIShv�N UR(a&[R
"SUR
5XS5 XS4$N>! UR5 e=f7f)Nz Read pipe %r connected: (%r, %r))r�rar�r�rr��fileno�r�r�r`rNr�r�s      r�connect_read_pipe�BaseEventLoop.connect_read_pipe�s}���#�%���#�#�%���2�2�4�6�J�	�	��L�L�
�;�;��L�L�;�����	�
=��"�"�
��	��O�O����+�*B	�A3�A1�A3�:B	�1A3�3B�B	c��# �U"5nUR5nURX#U5nUIShv�N UR(a&[R
"SUR
5XS5 XS4$N>! UR5 e=f7f)Nz!Write pipe %r connected: (%r, %r))r�rdr�r�rr�r�r�s      r�connect_write_pipe� BaseEventLoop.connect_write_pipe�s}���#�%���#�#�%���3�3�D�F�K�	�	��L�L�
�;�;��L�L�<�����	�
=��"�"�
��	��O�O���r�c�~�U/nUbURS[U535 Ub2U[R:XaURS[U535 O@UbURS[U535 UbURS[U535 [R
"SR
U55 g)Nzstdin=zstdout=stderr=zstdout=zstderr=� )rBr'r#r%rr�r�)r�rrirjrkrs      r�_log_subprocess�BaseEventLoop._log_subprocess�s����u�����K�K�&��e�!4� 5�6�7���&�J�,=�,=�"=��K�K�.��f�)=�(>�?�@��!����g�l�6�&:�%;�<�=��!����g�l�6�&:�%;�<�=����S�X�X�d�^�$r!)	rirjrk�universal_newlinesrhrl�encoding�errors�textc		��# �[U[[45(d[S5eU(a[S5eU(d[S5eUS:wa[S5eU(a[S5eU	b[S5eU
b[S5eU"5n
SnUR(aS	U-nURX�XE5 UR"X�S
X4XX40UD6IShv�NnUR(aUb[R"SX�5 X�4$N27f)Nzcmd must be a string� universal_newlines must be Falsezshell must be Truer�bufsize must be 0�text must be False�encoding must be None�errors must be Nonezrun shell command %rT�%s: %r)	rr<rr,r�r�rnrr)r�r��cmdrirjrkr�rhrlr�r�r�rmrN�	debug_logr�s                r�subprocess_shell�BaseEventLoop.subprocess_shell�s
����#��s�|�,�,��3�4�4���?�@�@���1�2�2��a�<��0�1�1���1�2�2����4�5�5����2�3�3�#�%���	��;�;�/��4�I�� � ��6�B��9�9��4���K�CI�K�K�	��;�;�9�0��K�K��)�7��"�"�	K�s�CD�D	�3Dc		���# �U(a[S5eU(a[S5eUS:wa[S5eU(a[S5eU	b[S5eU
b[S5eU4U-nU"5nSnUR(aSU<3nURUX4U5 UR"X�S	X4UU40U
D6IShv�NnUR(aUb[R
"S
UU5 UU4$N47f)Nr�zshell must be Falserr�r�r�r�zexecute program Fr�)r,r�r�rnrr)r�r��programrirjrkr�rhrlr�r�r�rgrm�
popen_argsrNr�r�s                  r�subprocess_exec�BaseEventLoop.subprocess_exec�s�����?�@�@���2�3�3��a�<��0�1�1���1�2�2����4�5�5����2�3�3��Z�$�&�
�#�%���	��;�;�+�7�+�6�I�� � ��E�6�B��9�9��%��������	��;�;�9�0��K�K��)�Y�7��(�"�"��s�B7C0�9C.�:5C0c��UR$)zKReturn an exception handler, or None if the default one is in use.
        )rr�s r�get_exception_handler�#BaseEventLoop.get_exception_handlers���&�&�&r!c�T�Ub[U5(d[SU<35eXlg)asSet handler as the new event loop exception handler.

If handler is None, the default exception handler will
be set.

If handler is a callable object, it should have a
signature matching '(loop, context)', where 'loop'
will be a reference to the active event loop, 'context'
will be a dict object (see `call_exception_handler()`
documentation for details about context).
Nz+A callable object or None is expected, got )rBr>r)r��handlers  r�set_exception_handler�#BaseEventLoop.set_exception_handlers6����x��'8�'8��#�#*�+�/�0�
0�")�r!c���URS5nU(dSnURS5nUb[U5X3R4nOSnSU;aAURb4URR(aURRUS'U/n[U5H�nUS;aMXnUS:Xa:S	R
[R"U55nS
nXxR5-
nOKUS:Xa:S	R
[R"U55nSnXxR5-
nO[U5nURUSU35 M� [R"S
R
U5US9 g)a�Default exception handler.

This is called when an exception occurs and no exception
handler is set, and can be called by a custom exception
handler that wants to defer to the default behavior.

This default handler logs the error message and other
context-dependent information.  In debug mode, a truncated
stack trace is also appended showing where the given object
(e.g. a handle or future or task) was created, if any.

The context parameter has the same meaning as in
`call_exception_handler()`.
r�z!Unhandled exception in event looprhNF�source_traceback�handle_traceback>r�rhr5z+Object created at (most recent call last):
z+Handle created at (most recent call last):
rJ�
r�)�getrG�
__traceback__r$r;�sortedr��	traceback�format_list�rstriprrBrr�)	r�r6r�rhr��	log_linesr��value�tbs	         r�default_exception_handler�'BaseEventLoop.default_exception_handlersS���+�+�i�(���9�G��K�K��,�	�� ��Y���4K�4K�L�H��H��g�-��$�$�0��$�$�6�6��$�$�6�6�
�&�'��I�	��'�?�C��.�.���L�E��(�(��W�W�Y�2�2�5�9�:��F������$���*�*��W�W�Y�2�2�5�9�:��F������$���U�������u�B�u�g�.�/�#� 	���T�Y�Y�y�)�H�=r!c���URcURU5 gSnURS5nUcURS5nUcURS5nUb![US5(aUR5nUb.[US	5(aURURX5 gURX5 g![[4a e[a [
R"SSS9 gf=f![[4a e[aYnURS
UUS.5 SnAg![[4a e[a [
R"SSS9 SnAgf=fSnAff=f)
a�Call the current event loop's exception handler.

The context argument is a dict containing the following keys:

- 'message': Error message;
- 'exception' (optional): Exception object;
- 'future' (optional): Future instance;
- 'task' (optional): Task instance;
- 'handle' (optional): Handle instance;
- 'protocol' (optional): Protocol instance;
- 'transport' (optional): Transport instance;
- 'socket' (optional): Socket instance;
- 'asyncgen' (optional): Asynchronous generator that caused
                         the exception.

New keys maybe introduced in the future.

Note: do not overload this method in an event loop subclass.
For custom exception handling, use the
`set_exception_handler()` method.
Nz&Exception in default exception handlerTr�r>r�r�get_context�runz$Unhandled error in exception handler)r�rhr6zeException in default exception handler while handling an unexpected error in custom exception handler)rrrirjr�rr�rr*rr)r�r6�ctx�thingrns     rr��$BaseEventLoop.call_exception_handlerJsr��,�"�"�*�	
,��.�.�w�7�$
0������F�+���=�$�K�K��1�E��=�#�K�K��1�E��$���
�)F�)F��+�+�-�C��?�w�s�E�':�':��G�G�D�3�3�T�C��+�+�D�:��3� 1�2�
�� �
,����E�&*�,�	
,��0� 1�2�
�� �
0�0��2�2�#I�%(�#*�4����
#�$5�6���$�0��L�L�"?�+/�0�0�0��
0�sG�C�BC9�2C9�/C6�5C6�9E,�D.�./E$�E'�#E$�$E'�'E,c�^�UR(dURRU5 gg)zAdd a Handle to _ready.N)�
_cancelledrrB�r�rs  r�
_add_callback�BaseEventLoop._add_callback�s"��� � ��K�K���v�&�!r!c�F�URU5 UR5 g)z6Like _add_callback() but called from a signal handler.N)rrqrs  r�_add_callback_signalsafe�&BaseEventLoop._add_callback_signalsafe�s�����6�"����r!c�R�UR(aU=RS-
slgg)z3Notification that a TimerHandle has been cancelled.rN)rrrs  r�_timer_handle_cancelled�%BaseEventLoop._timer_handle_cancelled�s!������'�'�1�,�'�r!c���[UR5nU[:�a{URU-[:�ad/nURH.nUR
(a	SUlMUR
U5 M0 [R"U5 X lSUlO�UR(a�URSR
(amU=RS-sl[R"UR5nSUlUR(a URSR
(aMmSnUR(dUR(aSnOTUR(aCURSRUR5-
nU[:�a[nOUS:aSnURR!U5nUR#U5 SnUR5UR$-nUR(auURSnURU:�aOU[R"UR5nSUlURR
U5 UR(aMu[UR5n['U5H�nURR)5nUR
(aM0UR*(asX0lUR5n	UR/5 UR5U	-
n
X�R0:�a![2R4"S[7U5U
5 SUlM�UR/5 M� Sng!SUlf=f)z�Run one full iteration of the event loop.

This calls all currently ready callbacks, polls for I/O,
schedules the resulting callbacks, and finally schedules
'call_later' callbacks.
FrrNzExecuting %s took %.3f seconds)r�r�_MIN_SCHEDULED_TIMER_HANDLESr�%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONrrBr��heapify�heappoprr�_whenr�MAXIMUM_SELECT_TIMEOUT�	_selector�selectrur�range�popleftr�r$�_runr#rr�r )r��sched_count�
new_scheduledrr�rt�end_time�ntodo�irrs           rr��BaseEventLoop._run_once�s����$�/�/�*���6�6��'�'�+�5�5�
6��M��/�/���$�$�(-�F�%�!�(�(��0�	*�
�M�M�-�(�+�O�*+�D�'��/�/�d�o�o�a�&8�&C�&C��+�+�q�0�+����t���7��$)��!��/�/�d�o�o�a�&8�&C�&C�&C�
���;�;�$�.�.��G�
�_�_��o�o�a�(�.�.�����<�G��/�/�0���1�����^�^�*�*�7�3�
����Z�(��
��9�9�;��!7�!7�7���o�o��_�_�Q�'�F��|�|�x�'���]�]�4�?�?�3�F� %�F���K�K���v�&�
�o�o�o��D�K�K� ���u��A��[�[�(�(�*�F�� � ���{�{�	0�+1�(�����B��K�K�M�����r�)�B��8�8�8����'G�'5�f�'=�r�C�,0�D�(����
�!�"���,0�D�(�s
�%A)M.�.	M7c�"�[U5[UR5:XagU(a?[R"5Ul[R
"[R5 O [R
"UR5 XlgrP)r{r&r��#get_coroutine_origin_tracking_depthr'�#set_coroutine_origin_tracking_depthr�DEBUG_STACK_DEPTH�r��enableds  rr��,BaseEventLoop._set_coroutine_origin_tracking�sk����=�D��!H�!H�I�I����7�7�9�
�7��3�3��+�+�
-�
�3�3��;�;�
=�3:�/r!c��UR$rP)r�r�s rr/�BaseEventLoop.get_debugs���{�{�r!c�t�XlUR5(aURURU5 ggrP)r�r-r}r�r=s  rr �BaseEventLoop.set_debugs/�����?�?����%�%�d�&I�&I�7�S�r!)r(r)rrr&r'r$r�rrr*rr"rrrr%rrr#rP)NNNr�)r)rN)FNN)Yr�r�r�r�r�r�r�r?rDrGrOrXr\rardrnrqrur:rzr�r�r�r�r�r�r�r�r�r�rlr�r.r�r�r�r-rr�r�r�r�r�r�r}rrrrr!r.r(r*r'rXrwrsr�r�r�r�r�r+r:ror�r?�
AI_PASSIVEr�r�r�r�r�r#r$r�r�rrrr�rr"r%r�r�r/r r�rQr!rrr�s ��/�@
�)�)-�d��*%�"�"�%)�$�"�9=�"� �$��t�"&�!%�!%�
"�CG�"�
@D�(,�"�
AE�)-�"�04�"�"�"�7�D�G�
"��2�0D�K�'�((� 	(�$�L�*�.�%�M�M��-� �:>��06:��$26��&%��(�"=A�	�5� *�
�2"#��!�1�H�7�
A�(,�
A�.�/�4�*).�X59�Q#����1�4��T�"&�!%�!%�$��Q#�j*/�"&�!%�	#�8-<�#'�-<�^1�"�4%*�(,�.2�-1�	.+�bEI�D#�./�q��26�7;�$�	D#�N'(�f�.@�.@�%&�a�
D��59�M��#�#��#�#�������"&�!%��M�b�"&�!%�	#�<#� #� %�&0�_�_�&0�o�o�&0�o�o�27�%)�1�(,�T��
"#�J%/�O�O�J�O�O�%/�_�_��$)�1�'+�D�t�	 #�D'�
*�"0>�dF0�P'�
�
-�
Q�f
:��Tr!r)rr)r)7�__doc__rV�collections.abc�concurrent.futuresrrNr�r[r�r+r�r#r�rrr�r�r�ru�ImportErrorr5rrrrrr	r
rrr
rr�logr�__all__r(r)r*rAr-r r'r2rMrerorrrw�Protocolry�AbstractServerr�AbstractEventLooprrQr!r�<module>rNs0��
�������	�
������
������������������$��
 #��),�%�
�F�J�'�	�#����J�8�v�,"��6�=�!�!�G�
�>�
A)�	� 2� 2�A)�HK�V�
"�
"�K�\iT�F�,�,�iT��}��
�C��s�D�D �D 

?>