Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
protocol.cpython-313.pyc88 linesDownload Raw Back to __pycache__
1�

2��j�'����SSKrSSKJrJrJrJrJrJrJrJ	r	 SSK3Jr SSKJ
r
Jr SSKJr \\/S4r\\R&\R(/S4r"SS\R,5r"S	S4\R05rg)�N)�Any�Callable�Dict�Optional�Text�Tuple�Union�cast�)�events)�NetworkAddress�QuicConnection)�
QuicErrorCodec���\rSrSrS!S\S\\4SjjrS"Sjr\	RS4S	\S5\SS4Sjjr
S#S\SS4S
jjrS$S\S\\R&\R(44SjjrS"SjrS"SjrS"SjrS"SjrS"SjrS\R6SS4SjrS\\\4S\SS4Sjr S\!RDSS4Sjr#S\S\\R&\R(44Sjr$S"Sjr%S"Sjr&S"Sjr'S r(g)%�QuicConnectionProtocol�N�quic�stream_handlerc�>�[R"5n[R"5UlSUlSUlX0l0UlXl0Ul	SUl6SUlSUlSUl
SUlSUlSUlUbX lgSUlg)NFc��g�N���cs �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\aioquic/asyncio/protocol.py�<lambda>�1QuicConnectionProtocol.__init__.<locals>.<lambda>s��PT�c��grrrs rrr s��QUrc��grrrrrrr!s��$rc��grr)�r�ws  rrr%s��r)�asyncio�get_event_loop�Event�_closed�7_connected�_connected_waiter�_loop�
_ping_waiters�_quic�_stream_readers�_timer�	_timer_at�_transmit_task�8_transport�_connection_id_issued_handler�_connection_id_retired_handler�_connection_terminated_handler�_stream_handler)�selfrr�loops    r�__init__�QuicConnectionProtocol.__init__
s����%�%�'���}�}�������AE����9�>@����10�@B���59���*.���8<���?C���GU��*�GU��+�BN��+��%�#1� �#4�D� r�returnc�X�URR5 UR5 g)zj11Change the connection ID used to communicate with the peer.12 13The previous connection ID will be retired.14N)r,�change_connection_id�transmit�r6s rr<�+QuicConnectionProtocol.change_connection_id's��	
�15�16�'�'�)��
�
�r��17error_code�
reason_phrasec�X�URRUUS9 UR5 g)z�18Close the connection.19 20:param error_code: An error code indicating why the connection is21                   being closed.22:param reason_phrase: A human-readable explanation of why the23                      connection is being closed.24)rArBN)r,�closer=)r6rArBs   rrD�QuicConnectionProtocol.close0s,��	
�25�26���!�'�	�	27�	
�
�
�r�addrc��URRXRR5S9 U(aUR	5 gg)z\28Initiate the TLS handshake.29 30This method can only be called for clients and a single time.31��nowN)r,�connectr*�timer=)r6rFr=s   rrJ�QuicConnectionProtocol.connectCs5��	
�32�33���4�Z�Z�_�_�%6��7���M�M�O�r�is_unidirectionalc��^# �URRUS9nURU5$7f)z�34Create a QUIC stream and return a pair of (reader, writer) objects.35 36The returned reader and writer objects are instances of37:class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter` classes.38)rM)r,�get_next_available_stream_id�_create_stream)r6rM�	stream_ids   r�
create_stream�$QuicConnectionProtocol.create_streamMs6����J�J�;�;�/�<�39�	��"�"�9�-�-�s�+-c�X�URR5 UR5 g)z+40Request an update of the encryption keys.41N)r,�request_key_updater=r>s rrU�)QuicConnectionProtocol.request_key_update[s��	
�42�43�%�%�'��
�
�rc��# �URR5n[U5nXRU'URRU5 UR
5 [R"U5IShv�N gN7f)z*44Ping the peer and wait for the response.45N)	r*�
create_future�idr+r,�	send_pingr=r$�shield)r6�waiter�uids   r�ping�QuicConnectionProtocol.pingbs]������)�)�+����j��"(���3���46�47���S�!��
�
���n�n�V�$�$�$�s�A8B�:B�;Bc���SUlURRURR	5S9H upUR48R
X5 M" URR5nURb1URU:wa!URR5 SUlURc-Ub*URRX0R5UlX0l	g)aU49Send pending datagrams to the peer and arm the timer if needed.50 51This method is called automatically when data is received from the peer52or when a timer goes off. If you interact directly with the underlying53:class:`~aioquic.quic.connection.QuicConnection`, make sure you call this54method whenever data needs to be sent out to the network.55NrH)
r0r,�datagrams_to_sendr*rKr1�sendto�	get_timerr.r/�cancel�call_at�
_handle_timer)r6�datarF�timer_ats    rr=�QuicConnectionProtocol.transmitms���#����*�*�6�6�4�:�:�?�?�;L�6�M�J�D��O�O�"�"�4�.�N��:�:�'�'�)���;�;�"�t�~�~��'A��K�K��� ��D�K��;�;��8�#7��*�*�,�,�X�7I�7I�J�D�K�!�rc��T# �URR5IShv�N gN7f)z'56Wait for the connection to be closed.57N)r'�waitr>s r�wait_closed�"QuicConnectionProtocol.wait_closed�s����l�l���!�!�!�s�(�&�(c���# �URbS5eUR(dHURR5Ul[R58"UR5IShv�N ggN7f)z)59Wait for the TLS handshake to complete.60Nzalready awaiting connected)r)r(r*rXr$r[r>s r�wait_connected�%QuicConnectionProtocol.wait_connected�s[����%�%�-�K�/K�K�-����%)�Z�Z�%=�%=�%?�D�"��.�.��!7�!7�8�8�8��8�s�A(A3�*A1�+A3�	transportc�B�[[RU5Ulg)�:meta private:N)r61r$�DatagramTransportr1)r6rqs  r�connection_made�&QuicConnectionProtocol.connection_made�s���w�8�8�)�D��rrgc���URR[[U5X RR5S9 UR
5 UR5 g)rsrHN)r,�receive_datagramr62�bytesr*rK�_process_eventsr=)r6rgrFs   r�datagram_received�(QuicConnectionProtocol.datagram_received�s@���63�64�#�#�D���$5�t�����AR�#�S������
�
�r�eventc��[U[R5(a2URR	5HnUR5 M g[U[R5(a�URRURS5nUc.URUR5up#URX#5 URUR5 UR(aUR5 ggg)z`65Called when a QUIC event is received.66 67Reimplement this in your subclass to handle the events.68N)�69isinstancer�ConnectionTerminatedr-�values�feed_eof�StreamDataReceived�getrQrPr5�	feed_datarg�70end_stream)r6r}�reader�writers    r�quic_event_received�*QuicConnectionProtocol.quic_event_received�s����e�V�8�8�9�9��.�.�5�5�7�����!�8�
��v�8�8�
9�
9��)�)�-�-�e�o�o�t�D�F��~�!%�!4�!4�U�_�_�!E����$�$�V�4����U�Z�Z�(�������!� �
:rrQc���[X5n[R"5n[RR	U5n[R71"X$X0R5nX0RU'X54$r)�QuicStreamAdapterr$�StreamReader�streams�StreamReaderProtocol�StreamWriterr*r-)r6rQ�adapterr��protocolr�s      rrP�%QuicConnectionProtocol._create_stream�s\��$�D�4���%�%�'���?�?�7�7��?���%�%�g����L��*0���Y�'��~�rc���[URURR55nSUlSUlUR72R
US9 UR5 UR5 g)NrH)	�maxr/r*rKr.r,�handle_timerrzr=)r6rIs  rrf�$QuicConnectionProtocol._handle_timer�sU���$�.�.�$�*�*�/�/�"3�4���������73�74���C��(������
�
�rc��URR5nUGb*[U[R5(aURUR5 GO�[U[R5(aURUR5 GO�[U[R5(a�UR5 URb(URnSUlUR[5 URR5HnUR[5 M URR!5 UR"R%5 O�[U[R&5(a9URb+URnSUlSUlUR+S5 OY[U[R,5(a:URR/UR0S5nUbUR+S5 UR3U5 URR5nUbGM)gg�NT)r,�75next_eventrr�ConnectionIdIssuedr2�
connection_id�ConnectionIdRetiredr3r�r4r)�
set_exception�ConnectionErrorr+r��clearr'�set�HandshakeCompletedr(�76set_result�PingAcknowledged�popr]r�)r6r}r\s   rrz�&QuicConnectionProtocol._process_events�s����77�78�%�%�'�����%��!:�!:�;�;��2�2�5�3F�3F�G��E�6�#=�#=�>�>��3�3�E�4G�4G�H��E�6�#>�#>�?�?��3�3�5��)�)�5�!�3�3�F�-1�D�*��(�(��9�#�0�0�7�7�9�F��(�(��9�:��"�"�(�(�*���� � �"��E�6�#<�#<�=�=��)�)�5�!�3�3�F�&*�D�O�-1�D�*��%�%�d�+���E�6�#:�#:�;�;��+�+�/�/��	�	�4�@���%��%�%�d�+��$�$�U�+��J�J�)�)�+�E�?�rc�t�URc+URRUR5Ulggr)r0r*�	call_soonr=r>s r�_transmit_soon�%QuicConnectionProtocol._transmit_soon�s.�����&�"&�*�*�"6�"6�t�}�}�"E�D��'r)r'r(r)r2r3r4r*r+r,r5r-r.r/r0r1r)r:N)T)F))�__name__�79__module__�__qualname__�__firstlineno__rr�QuicStreamHandlerr8r<r�NO_ERROR�int�strrDr
rJ�boolrr$r�r�rRrUr^r=rlro�
BaseTransportrur	ryrr{r�	QuicEventr�rPrfrzr��__static_attributes__rrrrrsE��RV�5�"�5�4<�=N�4O�5�4�(�0�0�������80�	�&�N��d��).�.�!%�.�	�w�#�#�W�%9�%9�9�	:�.��	%�"�0"�9�E��)>�)>�E�4�E��e�E�4�K�&8����SW��"��)9�)9�"�d�"�*���	�w�#�#�W�%9�%9�9�	:���!,�FFrrc�n�\rSrSrS\S\4SjrS\4SjrSS\	S	\81S\824S83jjrSrSr
S
rS\4SjrSrg)r���r�rQc�*�XlX lSUlg)NF)r�rQ�_closing)r6r�rQs   rr8�QuicStreamAdapter.__init__�s�� �
�"����
rr:c��gr�rr>s r�
can_write_eof�QuicStreamAdapter.can_write_eof�s��rN�name�defaultc�(�US:XaUR$g)z384Get information about the underlying QUIC stream.85rQN)rQ)r6r�r�s   r�get_extra_info� QuicStreamAdapter.get_extra_info�s���;���>�>�!�rc��URRRURU5 URR	5 gr)r�r,�send_stream_datarQr�)r6rgs  r�write�QuicStreamAdapter.writes0���
�
���,�,�T�^�^�T�B��
�
�$�$�&rc���UR(agSUlURRRURSSS9 URR5 g)NTr)r�)r�r�r,r�rQr�r>s r�	write_eof�QuicStreamAdapter.write_eofsF���=�=����
��
�
���,�,�T�^�^�S�T�,�R��
�
�$�$�&rc�$�UR5 gr)r�r>s rrD�QuicStreamAdapter.closes�����rc��UR$r)r�r>s r�86is_closing�QuicStreamAdapter.is_closings���}�}�r)r�r�rQr)r�r�r�r�rr�r8r�r�r�rr�r�r�rDr�r�rrrr�r��sW���!7��C��87�t��"�3�"��"��"�'�'���D�rr�)r$�typingrrrrrrr	r88rr�quic.connectionr
r�quic.packetrry�QuicConnectionIdHandlerr�r�r��DatagramProtocolr�	Transportr�rrr�<module>r�su���J�J�J��<�'�"�E�7�D�=�1���g�2�2�G�4H�4H�I�4�O�P��bF�W�5�5�bF�J��)�)�r
codekingpro/portable-devtools · Team Ai