Your IP : 18.226.186.153


Current Path : /opt/alt/python312/lib64/python3.12/asyncio/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/asyncio/__pycache__/windows_events.cpython-312.opt-2.pyc

�

�Q�fK����	ddlZejdk7red��ddlZddlZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZdZej4Zej6ZdZdZdZdZGd�dej@�Z!Gd�dej@�Z"Gd�de"�Z#Gd�de"�Z$Gd�de%�Z&Gd�dejN�Z(Gd �d!ejR�Z*Gd"�d#�Z+Gd$�d%ejX�Z-e(Z.Gd&�d'ej^�Z0Gd(�d)ej^�Z1e1Z2y)*�N�win32z
win32 only)�partial�)�events)�base_subprocess)�futures)�
exceptions)�proactor_events)�selector_events)�tasks)�
windows_utils)�logger)�SelectorEventLoop�ProactorEventLoop�IocpProactor�DefaultEventLoopPolicy�WindowsSelectorEventLoopPolicy�WindowsProactorEventLoopPolicyi�i�g����MbP?g�������?c�V��eZdZ	dd��fd�
Z�fd�Zd�Zd	�fd�	Z�fd�Z�fd�Z�xZ	S)
�_OverlappedFutureN��loopc�f��t�|�|��|jr
|jd=||_y�Nr���)�super�__init__�_source_traceback�_ov)�self�ovr�	__class__s   ��=/opt/alt/python312/lib64/python3.12/asyncio/windows_events.pyrz_OverlappedFuture.__init__7s1���
���d��#��!�!��&�&�r�*����c����t�|��}|j�H|jjrdnd}|j	dd|�d|jj
d�d��|S)N�pending�	completedrzoverlapped=<z, �#x�>)r�
_repr_inforr&�insert�address�r �info�stater"s   �r#r*z_OverlappedFuture._repr_info=s\����w�!�#���8�8��!%���!1�!1�I�{�E��K�K��\�%���4�8�8�3C�3C�B�2G�q�I�J��r$c��|j�y	|jj�d|_y#t$rM}d||d�}|jr|j|d<|jj|�Yd}~d|_yd}~wwxYw)Nz&Cancelling an overlapped future failed��message�	exception�future�source_traceback)r�cancel�OSErrorr�_loop�call_exception_handler)r �exc�contexts   r#�_cancel_overlappedz$_OverlappedFuture._cancel_overlappedDs����8�8���
	7��H�H�O�O�������	7�C� ���G�
�%�%�.2�.D�.D��*�+��J�J�-�-�g�6�6�����	7�s�1�	B�<B�Bc�D��|j�t�|�	|��S�N)�msg)r<rr6�r r?r"s  �r#r6z_OverlappedFuture.cancelTs ������!��w�~�#�~�&�&r$c�D��t�|�|�|j�y�N)r�
set_exceptionr<�r r3r"s  �r#rCz_OverlappedFuture.set_exceptionXs���
���i�(����!r$c�2��t�|�|�d|_yrB)r�
set_resultr�r �resultr"s  �r#rFz_OverlappedFuture.set_result\s���
���6�"���r$rB)
�__name__�
__module__�__qualname__rr*r<r6rCrF�
__classcell__�r"s@r#rr1s0����
$(���� '�"��r$rc�b��eZdZ	dd��fd�
Zd�Z�fd�Zd�Zd�Zd�fd�	Z�fd	�Z	�fd
�Z
�xZS)�_BaseWaitHandleFutureNrc���t�|�|��|jr
|jd=||_||_||_d|_y)NrrT)rrrr�_handle�_wait_handle�_registered)r r!�handle�wait_handlerr"s     �r#rz_BaseWaitHandleFuture.__init__dsL���
���d��#��!�!��&�&�r�*�������'��� ��r$c�d�tj|jd�tjk(S�Nr)�_winapi�WaitForSingleObjectrQ�
WAIT_OBJECT_0�r s r#�_pollz_BaseWaitHandleFuture._pollrs)���+�+�D�L�L�!�<��%�%�&�	'r$c���t�|��}|jd|jd���|j�%|j	�rdnd}|j|�|j
�|jd|j
d���|S)Nzhandle=r(�signaled�waitingzwait_handle=)rr*�appendrQr\rRr-s   �r#r*z _BaseWaitHandleFuture._repr_infows|����w�!�#�����g�d�l�l�2�.�/�0��<�<�#�"&�*�*�,�J�I�E��K�K������(��K�K�,�t�'8�'8��&<�=�>��r$c��d|_yrB)r)r �futs  r#�_unregister_wait_cbz)_BaseWaitHandleFuture._unregister_wait_cb�s����r$c��|jsyd|_|j}d|_	tj|�|jd�y#t$rh}|j
tjk7rAd||d�}|jr|j|d<|jj|�Yd}~yYd}~�~d}~wwxYw�NFz$Failed to unregister the wait handler1r5)rSrR�_overlapped�UnregisterWaitr7�winerror�ERROR_IO_PENDINGrr8r9rc�r rUr:r;s    r#�_unregister_waitz&_BaseWaitHandleFuture._unregister_wait�s������� ����'�'�� ���	��&�&�{�3�	
� � ��&���
	��|�|�{�;�;�;�E�!$�"���
�)�)�26�2H�2H�G�.�/��
�
�1�1�'�:��<��
	�s�A�	C�AB<�<Cc�D��|j�t�|�	|��Sr>)rkrr6r@s  �r#r6z_BaseWaitHandleFuture.cancel�s ��������w�~�#�~�&�&r$c�D��|j�t�|�	|�yrB)rkrrCrDs  �r#rCz#_BaseWaitHandleFuture.set_exception�s�������
���i�(r$c�D��|j�t�|�	|�yrB)rkrrFrGs  �r#rFz _BaseWaitHandleFuture.set_result�s�������
���6�"r$rB)rIrJrKrr\r*rcrkr6rCrFrLrMs@r#rOrOas6���<�8<� �'�
��
'�0'�)�#�#r$rOc�@��eZdZ	dd��fd�
Zd�Z�fd�Z�fd�Z�xZS)�_WaitCancelFutureNrc�:��t�|�||||��d|_y)Nr)rr�_done_callback)r r!�eventrUrr"s     �r#rz_WaitCancelFuture.__init__�s!���
����U�K�d��;�"��r$c��td��)Nz'_WaitCancelFuture must not be cancelled)�RuntimeErrorr[s r#r6z_WaitCancelFuture.cancel�s���D�E�Er$c�`��t�|�|�|j�|j|�yyrB)rrFrrrGs  �r#rFz_WaitCancelFuture.set_result�s/���
���6�"����*�����%�+r$c�`��t�|�|�|j�|j|�yyrB)rrCrrrDs  �r#rCz_WaitCancelFuture.set_exception�s/���
���i�(����*�����%�+r$)rIrJrKrr6rFrCrLrMs@r#rprp�s'����8<�#�
F�&�
&�&r$rpc�4��eZdZdd��fd�
Z�fd�Zd�Z�xZS)�_WaitHandleFutureNrc���t�|�||||��||_d|_t	j
dddd�|_d|_y)NrTF)rr�	_proactor�_unregister_proactorrf�CreateEvent�_event�
_event_fut)r r!rTrU�proactorrr"s      �r#rz_WaitHandleFuture.__init__�sG���
����V�[�t��<�!���$(��!�!�-�-�d�D�%��F�����r$c����|j�-tj|j�d|_d|_|jj|j�d|_t�|�!|�yrB)	r~rX�CloseHandlerr{�_unregisterrrrc)r rbr"s  �r#rcz%_WaitHandleFuture._unregister_wait_cb�sY����;�;�"�������,��D�K�"�D�O�	
���"�"�4�8�8�,����
��#�C�(r$c���|jsyd|_|j}d|_	tj||j�|jj|j|j�|_y#t
$rh}|jtjk7rAd||d�}|jr|j|d<|jj|�Yd}~yYd}~��d}~wwxYwre)rSrRrf�UnregisterWaitExr~r7rhrirr8r9r{�_wait_cancelrcrrjs    r#rkz"_WaitHandleFuture._unregister_wait�s������� ����'�'�� ���	��(�(��d�k�k�B��.�.�5�5�d�k�k�6:�6N�6N�P�����
	��|�|�{�;�;�;�E�!$�"���
�)�)�26�2H�2H�G�.�/��
�
�1�1�'�:��<��
	�s� A?�?	C0�AC+�+C0)rIrJrKrrcrkrLrMs@r#ryry�s���BF��)�$Pr$ryc�0�eZdZ	d�Zd�Zd�Zd�Zd�ZeZy)�
PipeServerc��||_tj�|_d|_d|_|j
d�|_y�NT)�_address�weakref�WeakSet�_free_instances�_pipe�_accept_pipe_future�_server_pipe_handle)r r,s  r#rzPipeServer.__init__�s;����
�&���0�����
�#'�� ��-�-�d�3��
r$c�L�|j|jd�c}|_|S�NF)r�r�)r �tmps  r#�_get_unconnected_pipez PipeServer._get_unconnected_pipes%��
�*�*�d�&>�&>�u�&E���T�Z��
r$c
�,�|j�rytjtjz}|r|tjz}tj
|j|tjtjztjztjtjtjtjtj�}tj|�}|j j#|�|SrB)�closedrX�PIPE_ACCESS_DUPLEX�FILE_FLAG_OVERLAPPED�FILE_FLAG_FIRST_PIPE_INSTANCE�CreateNamedPiper��PIPE_TYPE_MESSAGE�PIPE_READMODE_MESSAGE�	PIPE_WAIT�PIPE_UNLIMITED_INSTANCESr
�BUFSIZE�NMPWAIT_WAIT_FOREVER�NULL�
PipeHandler��add)r �first�flags�h�pipes     r#r�zPipeServer._server_pipe_handles����;�;�=���*�*�W�-I�-I�I����W�:�:�:�E��#�#��M�M�5��%�%��(E�(E�E����
��,�,��!�!�=�#8�#8��(�(�'�,�,�

8���'�'��*����� � ��&��r$c��|jduSrB)r�r[s r#r�zPipeServer.closed s���
�
��%�&r$c�
�|j�!|jj�d|_|j�J|jD]}|j	��d|_d|_|jj
�yyrB)r�r6r�r��closer��clear)r r�s  r#r�zPipeServer.close#sp���#�#�/��$�$�+�+�-�'+�D�$��=�=�$��,�,���
�
��-��D�J� �D�M�� � �&�&�(�%r$N)	rIrJrKrr�r�r�r��__del__�r$r#r�r��s'���4���$'�
)��Gr$r�c��eZdZy)�_WindowsSelectorEventLoopN)rIrJrKr�r$r#r�r�2s��1r$r�c�B��eZdZ	d�fd�	Z�fd�Zd�Zd�Z	dd�Z�xZS)rc�<��|�
t�}t�|�	|�yrB)rrr)r r�r"s  �r#rzProactorEventLoop.__init__9s�����#�~�H�
����"r$c���	|j|j�t�|�
�|j�a|jj
}|jj
�|�'|js|jj|�d|_yy#|j�a|jj
}|jj
�|�'|js|jj|�d|_wwxYwrB)
�	call_soon�_loop_self_readingr�run_forever�_self_reading_futurerr6r&r{r�)r r!r"s  �r#r�zProactorEventLoop.run_forever>s����	1��N�N�4�2�2�3��G��!��(�(�4��.�.�2�2���)�)�0�0�2��>�"�*�*��N�N�.�.�r�2�,0��)�5��t�(�(�4��.�.�2�2���)�)�0�0�2��>�"�*�*��N�N�.�.�r�2�,0��)�5�s�)B�A/D	c��K�|jj|�}|�d{���}|�}|j||d|i��}||fS7�%�w)N�addr��extra)r{�connect_pipe�_make_duplex_pipe_transport)r �protocol_factoryr,�fr��protocol�transs       r#�create_pipe_connectionz(ProactorEventLoop.create_pipe_connectionQsZ�����N�N�'�'��0���w��#�%���0�0��x�8>��7H�1�J���h���	�s�!A�A	�&Ac��f�����K�t���d�����fd�	��j���gS�w)Nc�J��d}	|ri|j�}�jj|��j�r|j	�y��}�j||d�i���j
�}|�y�jj|�}|�_	|j��y#t$r9|r#|j�dk7r|j	��j��Yyt$rz}|r9|j�dk7r&�jd||d��|j	�n$�j rt#j$d|d���j��Yd}~yd}~wt&j($r|r|j	�YyYywxYw)	Nr�r�rzPipe accept failed)r2r3r�zAccept pipe failed on pipe %rT)�exc_info)rHr��discardr�r�r�r�r{�accept_piper��add_done_callback�BrokenPipeError�filenor�r7r9�_debugr�warningr	�CancelledError)	r�r�r�r:r,�loop_accept_piper�r �servers	    �����r#r�z>ProactorEventLoop.start_serving_pipe.<locals>.loop_accept_pipe\st����D�)
6���8�8�:�D��*�*�2�2�4�8��}�}���
�
���/�1�H��4�4��h�v�w�.?�5�A��3�3�5���<���N�N�.�.�t�4��*./��*��#�#�$4�5��+#�
1��D�K�K�M�R�/��J�J�L����/�0��
1��D�K�K�M�R�/��/�/�#7�%(� $�1��
�J�J�L��[�[��N�N�#B�#'�$�8����/�0�0���,�,�
!���J�J�L��
!�s1�A
B7�/B7�B7�7?F"�8F"�A0E5�5(F"�!F"rB)r�r�)r r�r,r�r�s```@@r#�start_serving_pipez$ProactorEventLoop.start_serving_pipeYs2������G�$��+	6�+	6�Z	
���'�(��x��s�*1c	
��K�|j�}
t||||||||f|
|d�|	��}	|
�d{���|S7�#ttf$r�t$r+|j�|j
��d{���7�wxYw�w)N)�waiterr�)�
create_future�_WindowsSubprocessTransport�
SystemExit�KeyboardInterrupt�
BaseExceptionr��_wait)r r��args�shell�stdin�stdout�stderr�bufsizer��kwargsr��transps            r#�_make_subprocess_transportz,ProactorEventLoop._make_subprocess_transport�s������#�#�%��,�T�8�T�5�-2�F�F�G�7�4:�%�7�06�7��	��L�L��
�
���-�.�	���	��L�L�N��,�,�.� � ��	�s1�'A>�8�6�8�A>�8�;A;�3A6�4A;�;A>rB)	rIrJrKrr�r�r�r�rLrMs@r#rr6s%���<�#�
1�&�1�j04�r$rc���eZdZ	efd�Zd�Zd�Zd�Zd d�Zd�Z	e
d��Zed	��Z
d!d
�Zd!d�Zd!d�Zd!d
�Zd"d�Zd!d�Zd�Zd�Zd�Zd�Zd�Zd d�Zd�Zd�Zd�Zd�Zd�Zd�Zd d�Z d�Z!d�Z"d�Z#y)#rc��d|_g|_tjtjt
d|�|_i|_tj�|_
g|_tj�|_yrW)
r8�_resultsrf�CreateIoCompletionPort�INVALID_HANDLE_VALUEr��_iocp�_cacher�r�rS�
_unregistered�_stopped_serving)r �concurrencys  r#rzIocpProactor.__init__�s_����
���
� �7�7��,�,�d�A�{�D��
����"�?�?�,������ '��� 1��r$c�2�|j�td��y)NzIocpProactor is closed)r�rur[s r#�
_check_closedzIocpProactor._check_closed�s���:�:���7�8�8�r$c���dt|j�zdt|j�zg}|j�|j	d�d|j
j�ddj|��d�S)Nzoverlapped#=%sz
result#=%sr��<� r))�lenr�r�r�r`r"rI�join)r r.s  r#�__repr__zIocpProactor.__repr__�s_�� �3�t�{�{�#3�3��s�4�=�=�1�1�3���:�:���K�K��!�� �N�N�3�3�S�X�X�d�^�D�Dr$c��||_yrB)r8)r rs  r#�set_loopzIocpProactor.set_loop�s	����
r$Nc�z�|js|j|�|j}g|_	|d}S#d}wxYwrB)r�r\)r �timeoutr�s   r#�selectzIocpProactor.select�s:���}�}��J�J�w���m�m����
�	���C��$�C�s�6�:c�\�|jj�}|j|�|SrB)r8r�rF)r �valuerbs   r#�_resultzIocpProactor._result�s%���j�j�&�&�(�����u���
r$c���	|j�S#t$rD}|jtjtj
fvrt
|j���d}~wwxYwrB)�	getresultr7rhrf�ERROR_NETNAME_DELETED�ERROR_OPERATION_ABORTED�ConnectionResetErrorr�)r��keyr!r:s    r#�finish_socket_funczIocpProactor.finish_socket_func�sY��	��<�<�>�!���	��|�|�� A� A� +� C� C� E�E�*�C�H�H�5�5���	�s��	A�?A�Ac��	|j|||�S#t$r,}|jtjk(r	|dfcYd}~S�d}~wwxYwrB)rr7rhrf�ERROR_PORT_UNREACHABLE)�clsr�rr!�empty_resultr:s      r#�_finish_recvfromzIocpProactor._finish_recvfrom�sN��	��)�)�%��b�9�9���	��|�|�{�A�A�A�#�T�)�)���
	�s��	A
� A�A
�A�A
c��|j|�tjt�}	t	|t
j
�r"|j
|j�||�n |j|j�|�|j|||j�S#t$r|jd�cYSwxYw)Nr$)
�_register_with_iocprf�
Overlappedr��
isinstance�socket�WSARecvr��ReadFiler�r��	_registerr�r �conn�nbytesr�r!s     r#�recvzIocpProactor.recv�s���� � ��&�
�
#�
#�D�
)��	%��$��
�
�.��
�
�4�;�;�=�&�%�8����D�K�K�M�6�2��~�~�b�$��(?�(?�@�@���	%��<�<��$�$�	%���AB%�%C�Cc��|j|�tjt�}	t	|t
j
�r"|j
|j�||�n |j|j�|�|j|||j�S#t$r|jd�cYSwxYwrW)
r	rfr
r�rr�WSARecvIntor��ReadFileIntor�r�rr�r r�bufr�r!s     r#�	recv_intozIocpProactor.recv_into�s���� � ��&�
�
#�
#�D�
)��	#��$��
�
�.����t�{�{�}�c�5�9�������
�s�3��~�~�b�$��(?�(?�@�@���	#��<�<��?�"�	#�rc�*�|j|�tjt�}	|j	|j�||�|j||t|jd���S#t$r|jd�cYSwxYw)N)r$Nr$�r)r	rfr
r��WSARecvFromr�r�r�rrrrs     r#�recvfromzIocpProactor.recvfrom�s���� � ��&�
�
#�
#�D�
)��	-��N�N�4�;�;�=�&�%�8��~�~�b�$���0E�0E�=@�)B�C�	C���	-��<�<��,�,�	-���!A5�5B�Bc�*�|j|�tjt�}	|j	|j�||�|j||t|jd���S#t$r|jd�cYSwxYw)N�rNrr)r	rfr
r��WSARecvFromIntor�r�r�rrrrs     r#�
recvfrom_intozIocpProactor.recvfrom_intos���� � ��&�
�
#�
#�D�
)��	+����t�{�{�}�c�5�9��~�~�b�$���0E�0E�=>�)@�A�	A���	+��<�<�	�*�*�	+�rc���|j|�tjt�}|j	|j�|||�|j
|||j�SrB)r	rfr
r��	WSASendTor�rr)r rrr�r�r!s      r#�sendtozIocpProactor.sendtosQ��� � ��&�
�
#�
#�D�
)��
���T�[�[�]�C���5��~�~�b�$��(?�(?�@�@r$c�H�|j|�tjt�}t	|t
j
�r"|j
|j�||�n |j|j�|�|j|||j�SrB)r	rfr
r�rr�WSASendr��	WriteFilerrrs     r#�sendzIocpProactor.sendsq��� � ��&�
�
#�
#�D�
)���d�F�M�M�*��J�J�t�{�{�}�c�5�1��L�L������,��~�~�b�$��(?�(?�@�@r$c�|���|j��|j�j��tjt
�}|j
�j��j����fd�}d�}|j|�|�}||��}tj||j��|S)Nc�,��|j�tjd�j��}�j	t
jtj|��j�j����j�fS)Nz@P)r��struct�packr��
setsockoptr�
SOL_SOCKETrf�SO_UPDATE_ACCEPT_CONTEXT�
settimeout�
gettimeout�getpeername)r�rr!rr�listeners    ��r#�
finish_acceptz*IocpProactor.accept.<locals>.finish_accept*sl����L�L�N��+�+�d�H�O�O�$5�6�C��O�O�F�-�-�'�@�@�#�
G��O�O�H�/�/�1�2���)�)�+�+�+r$c��vK�	|�d{���y7�#tj$r|j��wxYw�wrB)r	r�r�)r4rs  r#�accept_coroz(IocpProactor.accept.<locals>.accept_coro3s2����
������,�,�
��
�
���
�s �9����9��%6�9r)r	�_get_accept_socket�familyrfr
r��AcceptExr�rr�
ensure_futurer8)r r5r!r6r8r4�corors `     @r#�acceptzIocpProactor.accept$s����� � ��*��&�&�x���7��
�
#�
#�D�
)��
���H�O�O�%�t�{�{�}�5�	,�	�����H�m�<���6�4�(��
���D�t�z�z�2��
r$c����jtjk(rQtj�j�|�|jj�}|jd�|S|j��	tj�j��j�tj"t$�}|j'�j�|��fd�}|j)|�|�S#t$r?}|jtjk7r��j!�ddk(r�Yd}~��d}~wwxYw)Nrrc���|j��jtjtj
d��SrW)r�r/rr0rf�SO_UPDATE_CONNECT_CONTEXT)r�rr!rs   �r#�finish_connectz,IocpProactor.connect.<locals>.finish_connectVs1����L�L�N��O�O�F�-�-�'�A�A�1�
F��Kr$)�typer�
SOCK_DGRAMrf�
WSAConnectr�r8r�rFr	�	BindLocalr:r7rh�errno�	WSAEINVAL�getsocknamer
r��	ConnectExr)r rr,rb�er!rBs `     r#�connectzIocpProactor.connect@s����9�9��)�)�)�
�"�"�4�;�;�=�'�:��*�*�*�*�,�C��N�N�4� ��J�� � ��&�	��!�!�$�+�+�-����=��
#�
#�D�
)��
���T�[�[�]�G�,�	��~�~�b�$��7�7��!�	��z�z�U�_�_�,�����!�!�$��)��*��		�s�.D�	E	�
5E�E	c	�6�|j|�tjt�}|dz}|dz	dz}|j	|j�t
j|j��|||dd�|j|||j�S)Nl��� r)
r	rfr
r��TransmitFiler��msvcrt�
get_osfhandlerr)r �sock�file�offset�countr!�
offset_low�offset_highs        r#�sendfilezIocpProactor.sendfile_s���� � ��&�
�
#�
#�D�
)���k�)�
���|�{�2��
������
��,�,�T�[�[�]�;�"�K��q�!�	%�
�~�~�b�$��(?�(?�@�@r$c����|j��tjt�}|j	�j��}|r|j
��S�fd�}|j|�|�S)Nc�(��|j��SrB)r�)r�rr!r�s   �r#�finish_accept_pipez4IocpProactor.accept_pipe.<locals>.finish_accept_pipevs����L�L�N��Kr$)r	rfr
r��ConnectNamedPiper�r�r)r r�r!�	connectedr[s `   r#r�zIocpProactor.accept_pipeksf���� � ��&�
�
#�
#�D�
)���'�'����
�6�	���<�<��%�%�	��~�~�b�$�(:�;�;r$c��<K�t}		tj|�}	tj|�S#t$r(}|jtj
k7r�Yd}~nd}~wwxYwt
|dzt�}tj|��d{���7���w)N�)�CONNECT_PIPE_INIT_DELAYrf�ConnectPiper7rh�ERROR_PIPE_BUSY�min�CONNECT_PIPE_MAX_DELAYr�sleepr
r�)r r,�delayrTr:s     r#r�zIocpProactor.connect_pipe|s�����'���
�$�0�0��9����'�'��/�/���
��<�<�;�#>�#>�>��?��
��
���	�#9�:�E��+�+�e�$�$�$��s6�B�6�B�	A'�A"�B�"A'�'.B�B�Bc�*�	|j||d�Sr�)�_wait_for_handle)r rTr�s   r#�wait_for_handlezIocpProactor.wait_for_handle�s��	�
�$�$�V�W�e�<�<r$c�:�|j|dd�}||_|Sr�)rhrr)r rs�
done_callbackrbs    r#r�zIocpProactor._wait_cancel�s%���#�#�E�4��6��+����
r$c����|j�|�tj}ntj|dz�}tjt�}tj||j|j|�}|rt||||j���nt|||||j����jr
�jd=�fd�}�|d|f|j|j<�S)N�@�@rrc�$���j�SrB)r\)r�rr!r�s   �r#�finish_wait_for_handlez=IocpProactor._wait_for_handle.<locals>.finish_wait_for_handle�s����7�7�9�r$r)r�rX�INFINITE�math�ceilrfr
r��RegisterWaitWithQueuer�r,rpr8ryrr�)	r rTr��
_is_cancel�msr!rUror�s	        @r#rhzIocpProactor._wait_for_handle�s���������?��!�!�B����7�S�=�)�B��
#�
#�D�
)��!�7�7��D�J�J��
�
�B�0���!�"�f�k��
�
�K�A�!�"�f�k�4�'+�z�z�3�A�����#�#�B�'�	�$%�b�!�-C�"D����B�J�J���r$c��||jvrL|jj|�tj|j	�|j
dd�yyrW)rSr�rfr�r�r��r �objs  r#r	z IocpProactor._register_with_iocp�sI���d�&�&�&���� � ��%��.�.�s�z�z�|�T�Z�Z��A�N�'r$c�^�|j�t||j��}|jr
|jd=|js	|dd|�}|j|�||||f|j|j<|S#t$r}|j|�Yd}~�>d}~wwxYwr)
r�rr8rr&rFr7rCr�r,)r r!rx�callbackr�r�rKs       r#rzIocpProactor._register�s�������

�b�t�z�z�2������#�#�B�'��z�z�

$� ��t�R�0�����U�#�$%�b�#�x�"8����B�J�J������
#�����"�"��
#�s�
B�	B,�B'�'B,c�\�	|j�|jj|�yrB)r�r�r`)r r!s  r#r�zIocpProactor._unregister�s)��	�	
�������!�!�"�%r$c�R�tj|�}|jd�|SrW)rr2)r r:�ss   r#r9zIocpProactor._get_accept_socket�s ���M�M�&�!��	���Q���r$c	�"�|�t}n<|dkrtd��tj|dz�}|tk\rtd��	t	j
|j|�}|�n�d}|\}}}}	|jj|�\}}	}
}|
|j vr|j#�nI|j%�s9	||||	�}|j'|�|j(j+|�d}��|j0D](}	|jj|	j2d��*|j0j5�y#t$rl|jj�r%|jjdd||||fzd��|dtjfvrtj|�Y��}wxYw#t,$r7}
|j/|
�|j(j+|�Yd}
~
��d}
~
wwxYw#d}wxYw)Nrznegative timeoutrmztimeout too bigz8GetQueuedCompletionStatus() returned an unexpected eventz)err=%s transferred=%s key=%#x address=%#x)r2�status)rp�
ValueErrorrqrrrf�GetQueuedCompletionStatusr�r��pop�KeyErrorr8�	get_debugr9r�rXr�r�r6�donerFr�r`r7rCr�r,r�)r r�rur�err�transferredrr,r�r!rxrzr�rKs              r#r\zIocpProactor._poll�s����?��B�
�q�[��/�0�0����7�S�=�)�B��X�~� �!2�3�3�� �:�:�4�:�:�r�J�F��~���B�-3�*�C��c�7�
�'+�{�{���w�'?�$��2�s�H� �d�+�+�+����
��V�V�X�	�$�[�#�r�:�E�
�L�L��'��M�M�(�(��+��A�M�R�$�$�B��K�K�O�O�B�J�J��-�%���� � �"��E�

��:�:�'�'�)��J�J�5�5�%7�#N�&)�;��W�%E�$F�7���q�+�"B�"B�C�C��'�'��,��

��,�,��O�O�A�&��M�M�(�(��+�+��,���A�sC�4 E�
G�,H
�A1G�G�	H�,H�<H
�H�H
�
Hc�:�|jj|�yrB)r�r�rws  r#�
_stop_servingzIocpProactor._stop_serving2s��	
���!�!�#�&r$c�4�|j�yt|jj��D]:\}}}}|j	�r�t|t�r�*	|j��<d}tj�}||z}	|jrx|	tj�krCtjd|tj�|z
�tj�|z}	|j!|�|jr�xg|_t%j&|j�d|_y#t$rS}|j�<d||d�}|jr|j|d<|jj|�Yd}~��ad}~wwxYw)NzCancelling a future failedr1r5g�?z,%r is running after closing for %.1f seconds)r��listr��values�	cancelledrrpr6r7r8rr9�time�	monotonicr�debugr\r�rXr�)
r rbr!rxrzr:r;�
msg_update�
start_time�next_msgs
          r#r�zIocpProactor.close8s[���:�:���'+�4�;�;�+=�+=�+?�&@�"�C��S�(��}�}����C�!2�3��C��J�J�L�'A�0�
��^�^�%�
��
�*���k�k��4�>�>�+�+����K�!�4�>�>�#3�j�#@�B��>�>�+�j�8��
�J�J�z�"��k�k���
����D�J�J�'���
��;�	C��z�z�-�'C�),�&)�#��
�0�0�:=�:O�:O�G�$6�7��
�
�9�9�'�B���	C�s�D;�;	F�AF�Fc�$�|j�yrB)r�r[s r#r�zIocpProactor.__del__gs���
�
�r$rB)rr!)$rIrJrKrprr�r�r�r�r��staticmethodr�classmethodrrrrr#r&r*r>rLrXr�r�rir�rhr	rr�r9r\r�r�r�r�r$r#rr�s���-�#+�2�9�E��	��
�����	��	�A�A�	C�	A�A�A��88�>
A�<�"0�&=�� �DO��@&��
7#�r'�-�^r$rc��eZdZd�Zy)r�c	���tj|f|||||d�|���_�fd�}�jjjt
�jj��}	|	j|�y)N)r�r�r�r�r�c�\���jj�}�j|�yrB)�_proc�poll�_process_exited)r��
returncoder s  �r#rzz4_WindowsSubprocessTransport._start.<locals>.callbackrs!��������*�J�� � ��,r$)	r
�Popenr�r8r{ri�intrQr�)
r r�r�r�r�r�r�r�rzr�s
`         r#�_startz"_WindowsSubprocessTransport._startmso���"�(�(��'��U�6�&��'�%�'��
�	-�
�J�J� � �0�0��T�Z�Z�5G�5G�1H�I��	���H�%r$N)rIrJrKr�r�r$r#r�r�ks��
&r$r�c��eZdZeZy)rN)rIrJrKr�
_loop_factoryr�r$r#rr}���%�Mr$rc��eZdZeZy)rN)rIrJrKrr�r�r$r#rr�r�r$r)3�sys�platform�ImportErrorrfrXrG�	functoolsrrqrPrr-r�r��rrrr	r
rrr
�logr�__all__r�rp�ERROR_CONNECTION_REFUSED�ERROR_CONNECTION_ABORTEDr`rd�FuturerrOrpry�objectr��BaseSelectorEventLoopr��BaseProactorEventLooprr�BaseSubprocessTransportr�r�BaseDefaultEventLoopPolicyrrrr�r$r#�<module>r�s\��4�
��<�<�7��
�l�
#�#������
�
�
���������������|�|���������� ����-����-�`G#�G�N�N�G#�T&�-�&�01P�-�1P�h8��8�v2�� E� E�2�g��=�=�g�TH�H�V&�/�"I�"I�&�.��&�V�%F�%F�&�&�V�%F�%F�&�8�r$

?>