Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
socketserver.cpython-314.pyc358 linesDownload Raw Back to __pycache__
1+
2��i�m���RtRt^RIt^RIt^RIt^RIt^RIt^RIHt^RI	H3t	.R2Ot]!]R4'd]P.R3O4]!]R4'd6]P.R4O4]!]R4'd]PRR.4]!]R4'd]PtM]P t!RR4t!RR]4t!RR]4t]!]R4'd!RR4t!RR]4t!R R!4t!R"R
4t]!]R4'd!R#R]]4t!R$R]]4t!R%R]]4t!R&R	]]4t]!]R4'dV!R'R]4t!R(R]4t!R)R]]4t!R*R]]4t ]!]R4'd!R+R]]4t!!R,R]]4t"!R-R44t#!R.R]#4t$!R/R0]4t%!R1R]#4t&R#)5aqGeneric socket server classes.5 6This module tries to capture the various aspects of defining a server:7 8For socket-based servers:9 10- address family:11        - AF_INET{,6}: IP (Internet Protocol) sockets (default)12        - AF_UNIX: Unix domain sockets13        - others, e.g. AF_DECNET are conceivable (see <socket.h>14- socket type:15        - SOCK_STREAM (reliable stream, e.g. TCP)16        - SOCK_DGRAM (datagrams, e.g. UDP)17 18For request-based servers (including socket-based):19 20- client address verification before further looking at the request21        (This is actually a hook for any processing that needs to look22         at the request before anything else, e.g. logging)23- how to handle multiple requests:24        - synchronous (one request is handled at a time)25        - forking (each request is handled by a new process)26        - threading (each request is handled by a new thread)27 28The classes in this module favor the server type that is simplest to29write: a synchronous TCP/IP server.  This is bad class design, but30saves some typing.  (There's also the issue that a deep class hierarchy31slows down method lookups.)32 33There are five classes in an inheritance diagram, four of which represent34synchronous servers of four types:35 36        +------------+37        | BaseServer |38        +------------+39              |40              v41        +-----------+        +------------------+42        | TCPServer |------->| UnixStreamServer |43        +-----------+        +------------------+44              |45              v46        +-----------+        +--------------------+47        | UDPServer |------->| UnixDatagramServer |48        +-----------+        +--------------------+49 50Note that UnixDatagramServer derives from UDPServer, not from51UnixStreamServer -- the only difference between an IP and a Unix52stream server is the address family, which is simply repeated in both53unix server classes.54 55Forking and threading versions of each type of server can be created56using the ForkingMixIn and ThreadingMixIn mix-in classes.  For57instance, a threading UDP server class is created as follows:58 59        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass60 61The Mix-in class must come first, since it overrides a method defined62in UDPServer! Setting the various member variables also changes63the behavior of the underlying server mechanism.64 65To implement a service, you must derive a class from66BaseRequestHandler and redefine its handle() method.  You can then run67various versions of the service by combining one of the server classes68with your request handler class.69 70The request handler class must be different for datagram or stream71services.  This can be hidden by using the request handler72subclasses StreamRequestHandler or DatagramRequestHandler.73 74Of course, you still have to use your head!75 76For instance, it makes no sense to use a forking server if the service77contains state in memory that can be modified by requests (since the78modifications in the child process would never reach the initial state79kept in the parent process and passed to each child).  In this case,80you can use a threading server, but you will probably have to use81locks to avoid two requests that come in nearly simultaneous to apply82conflicting changes to the server state.83 84On the other hand, if you are building e.g. an HTTP server, where all85data is stored externally (e.g. in the file system), a synchronous86class will essentially render the service "deaf" while one request is87being handled -- which may be for a very long time if a client is slow88to read all the data it has requested.  Here a threading or forking89server is appropriate.90 91In some cases, it may be appropriate to process part of a request92synchronously, but to finish processing in a forked child depending on93the request data.  This can be implemented by using a synchronous94server and doing an explicit fork in the request handler class95handle() method.96 97Another approach to handling multiple simultaneous requests in an98environment that supports neither threads nor fork (or where these are99too expensive or inappropriate for the service) is to maintain an100explicit table of partially finished requests and to use a selector to101decide which request to work on next (or whether to handle a new102incoming request).  This is particularly important for stream services103where each client can potentially be connected for a long time (if104threads or subprocesses cannot be used).105 106Future work:107- Standard classes for Sun RPC (which uses either UDP or TCP)108- Standard mix-in classes to implement various authentication109  and encryption schemes110 111XXX Open problems:112- What to do with out-of-band data?113 114BaseServer:115- split generic "request" functionality out into BaseServer class.116  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>117 118  example: read entries from a SQL database (requires overriding119  get_request() to return a table entry from the database).120  entry is processed by a RequestHandlerClass.121 122z0.4N)�BufferedIOBase)�	monotonic�123BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�ForkingUnixStreamServer�ForkingUnixDatagramServer�PollSelectorc�a�]tRt^�toRtRtRtRtRRltRt	Rt124RtR	tR125t
RtRtR
tRtRtRtRtRtRtRtVtR#)raSBase class for server classes.126 127Methods for the caller:128 129- __init__(server_address, RequestHandlerClass)130- serve_forever(poll_interval=0.5)131- shutdown()132- handle_request()  # if you do not use serve_forever()133- fileno() -> int   # for selector134 135Methods that may be overridden:136 137- server_bind()138- server_activate()139- get_request() -> request, client_address140- handle_timeout()141- verify_request(request, client_address)142- server_close()143- process_request(request, client_address)144- shutdown_request(request)145- close_request(request)146- service_actions()147- handle_error()148 149Methods for derived classes:150 151- finish_request(request, client_address)152 153Class variables that may be overridden by derived classes or154instances:155 156- timeout157- address_family158- socket_type159- allow_reuse_address160- allow_reuse_port161 162Instance variables:163 164- RequestHandlerClass165- socket166 167Nc�`�WnW n\P!4VnRVnR#)�/Constructor.  May be extended, do not override.FN)�server_address�RequestHandlerClass�	threading�Event�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrrs&&&�Lib\socketserver.py�__init__�BaseServer.__init__�s%��,��#6� �'�o�o�/���"'���c��R#�zCCalled by constructor to activate the server.168 169May be overridden.170 171N��r"s&r#�server_activate�BaseServer.server_activate����	
r&c�&�VPP4\4;_uu_4pVPV\P1724VP'gOVPV4pVP'dM*V'dVP4VP4K`RRR4RVnVPP4R# +'giL3;i RTnTPP4i;i)z�Handle one request at a time until shutdown.173 174Polls for shutdown every poll_interval seconds. Ignores175self.timeout. If you need to do periodic tasks, do them in176another thread.177NF)r �clear�_ServerSelector�register�	selectors�178EVENT_READr!�select�_handle_request_noblock�service_actions�set)r"�
poll_interval�selector�readys&&  r#�
serve_forever�BaseServer.serve_forever�s���	
���!�!�#�	&�179!�"�"�h��!�!�$�	�(<�(<�=��1�1�1�$�O�O�M�:�E��.�.�.����4�4�6��(�(�*�#�',�D�#����#�#�%�#�"��',�D�#����#�#�%�s4�C-�2C�!"C�C�
"C�/C-�C*	�%C-�-#Dc�H�RVnVPP4R#)z�Stops the serve_forever loop.180 181Blocks until the loop has finished. This must be called while182serve_forever() is running in another thread, or it will183deadlock.184TN)r!r �waitr*s&r#�shutdown�BaseServer.shutdown�s��#'������ � �"r&c��R#)z�Called by the serve_forever() loop.185 186May be overridden by a subclass / Mixin to implement any code that187needs to be run during the loop.188Nr)r*s&r#r6�BaseServer.service_actionsr-r&c�.�VPP4pVfVPpM#VPe\WP4pVe\	4V,p\4;_uu_4pVP
V\P4VPV4'dVP4uuRRR4#VfK8X\	4,189pV^8gKRVP4uuRRR4# +'giR#;i)z?Handle one request, possibly blocking.190 191Respects self.timeout.192N)�socket�193gettimeout�timeout�min�timer0r1r2r3r4r5�handle_timeout)r"rF�deadliner9s&   r#�handle_request�BaseServer.handle_requests����+�+�(�(�*���?��l�l�G�
�\�\�
%��'�<�<�0�G����v��'�H��
�
�(����d�I�$8�$8�9���?�?�7�+�+��7�7�9��
��*�"*�T�V�"3��"�Q�;�#'�#6�#6�#8��
�
�
�s$�68D�/D�	D�D�)D�D	c�T�VP4wrTPY4'dTPY4R#TP
T4R# \dR#i;i \d'TPY4TP
T4R#TP
T4h;i)z�Handle one request, without blocking.194 195I assume that selector.select() has returned that the socket is196readable before this function was called, so there should be no risk of197blocking in get_request().198N)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r"�request�client_addresss&  r#r5�"BaseServer._handle_request_noblock1s���	�&*�&6�&6�&8�#�G����w�7�7�
��$�$�W�=�
�!�!�'�*���	��	��199�
/��!�!�'�:��%�%�g�.�
��%�%�g�.��s"�A�A$�A!� A!�$-B'�B'c��R#)zSCalled if no new request arrives within self.timeout.200 201Overridden by ForkingMixIn.202Nr)r*s&r#rI�BaseServer.handle_timeoutHs��203	
r&c��R#)z^Verify the request.  May be overridden.204 205Return True if we should proceed with this request.206 207Tr)rUs&&&r#rP�BaseServer.verify_requestOs��r&c�J�VPW4VPV4R#)zFCall finish_request.208 209Overridden by ForkingMixIn and ThreadingMixIn.210 211N)�finish_requestrTrUs&&&r#rQ�BaseServer.process_requestWs ��	
���G�4����g�&r&c��R#�z4Called to clean-up the server.212 213May be overridden.214 215Nr)r*s&r#�server_close�BaseServer.server_close`r-r&c�*�VPWV4R#)z8Finish one request by instantiating RequestHandlerClass.N)rrUs&&&r#r^�BaseServer.finish_requesths��� � ��$�?r&c�(�VPV4R#�z3Called to shutdown and close an individual request.N��
close_request�r"rVs&&r#rT�BaseServer.shutdown_requestl������7�#r&c��R#�z)Called to clean up an individual request.Nr)rjs&&r#ri�BaseServer.close_requestp���r&c���\R\PR7\RV\PR7^RIpVP	4\R\PR7R#)zdHandle an error gracefully.  May be overridden.216 217The default is to print a traceback and continue.218 219)�filez4Exception occurred during processing of request fromNz(----------------------------------------)�print�sys�stderr�	traceback�	print_exc)r"rVrWrvs&&& r#rS�BaseServer.handle_errortsC��	�f�3�:�:�&�
�D�����	-������
�f�3�:�:�&r&c��V#�Nr)r*s&r#�	__enter__�BaseServer.__enter__�s���r&c�&�VP4R#rz)rb)r"�argss&*r#�__exit__�BaseServer.__exit__�s�����r&)r�__is_shut_down�__shutdown_requestr)g�?)�__name__�220__module__�__qualname__�__firstlineno__�__doc__rFr$r+r;r?r6rKr5rIrPrQrbr^rTrirSr{r�__static_attributes__�__classdictcell__��
__classdict__s@r#rr�sm����*�X�G�(�
�&�:#�
�&9�:+�.
��'�
�@�$�
�'���r&c�a�]tRtRtoRt]Pt]Pt	^t221RtRtRRlt
RtRtRtRtR	tR222tRtRtVtR
#)ri�a�Base class for various socket-based server classes.223 224Defaults to synchronous IP stream (i.e., TCP).225 226Methods for the caller:227 228- __init__(server_address, RequestHandlerClass, bind_and_activate=True)229- serve_forever(poll_interval=0.5)230- shutdown()231- handle_request()  # if you don't use serve_forever()232- fileno() -> int   # for selector233 234Methods that may be overridden:235 236- server_bind()237- server_activate()238- get_request() -> request, client_address239- handle_timeout()240- verify_request(request, client_address)241- process_request(request, client_address)242- shutdown_request(request)243- close_request(request)244- handle_error()245 246Methods for derived classes:247 248- finish_request(request, client_address)249 250Class variables that may be overridden by derived classes or251instances:252 253- timeout254- address_family255- socket_type256- request_queue_size (only for stream sockets)257- allow_reuse_address258- allow_reuse_port259 260Instance variables:261 262- server_address263- RequestHandlerClass264- socket265 266Fc��\PWV4\P!VPVP4VnV'd$VP4VP
4R#R# TP4h;i)rN)rr$rD�address_family�socket_type�server_bindr+rb)r"rr�bind_and_activates&&&&r#r$�TCPServer.__init__�so�����D�2E�F��m�m�D�$7�$7�$(�$4�$4�6����
�� � �"��$�$�&���
��!�!�#��s� A4�4Bc�p�VP'dP\\R4'd:VPP\P\P267^4VP'd\\R4'diVP\P\P39d:VPP\P\P^4VPPVP4VPP4VnR#)z?Called by constructor to bind the socket.268 269May be overridden.270 271�SO_REUSEADDR�SO_REUSEPORTN)�allow_reuse_address�hasattrrD�272setsockopt�273SOL_SOCKETr��allow_reuse_portr��AF_INET�AF_INET6r��bindr�getsocknamer*s&r#r��TCPServer.server_bind�s����#�#�#����(G�(G��K�K�"�"�6�#4�#4�f�6I�6I�1�M�
�!�!�!�g�f�n�&E�&E��#�#�������'H�H��K�K�"�"�6�#4�#4�f�6I�6I�1�M�������,�,�-�"�k�k�5�5�7��r&c�P�VPPVP4R#r()rD�listen�request_queue_sizer*s&r#r+�TCPServer.server_activate�s��	
�����4�2�2�3r&c�:�VPP4R#ra)rD�closer*s&r#rb�TCPServer.server_close�s��	
�����r&c�6�VPP4#)z=Return socket file number.274 275Interface required by selector.276 277)rD�filenor*s&r#r��TCPServer.fileno�����{�{�!�!�#�#r&c�6�VPP4#)zIGet the request and client address from the socket.278 279May be overridden.280 281)rD�acceptr*s&r#rN�TCPServer.get_request�r�r&c��VP\P4VP	V4R# \dL i;irg)r?rD�SHUT_WRrOrirjs&&r#rT�TCPServer.shutdown_requests?��	�
���V�^�^�,�	
���7�#���	��	�s�4�A�Ac�&�VP4R#rn)r�rjs&&r#ri�TCPServer.close_requests���
�
�r&)rrDN�T)r�r�r�r�r�rDr�r��SOCK_STREAMr�r�r�r�r$r�r+rbr�rNrTrir�r�r�s@r#rr�s`����,�\�^�^�N��$�$�K��������8�$4��$�$�$��r&c�`a�]tRtRtoRtRtRt]Pt	Rt282RtRtRt
RtR	tVtR283#)rizUDP server class.Fi c�n�VPPVP4wrWP3V3#rz)rD�recvfrom�max_packet_size)r"�data�client_addrs&  r#rN�UDPServer.get_requests1�� �K�K�0�0��1E�1E�F����k�k�"�K�/�/r&c��R#rzr)r*s&r#r+�UDPServer.server_activate rpr&c�(�VPV4R#rzrhrjs&&r#rT�UDPServer.shutdown_request$rlr&c��R#rzr)rjs&&r#ri�UDPServer.close_request(rpr&r)N)r�r�r�r�r�r�r�rD�284SOCK_DGRAMr�r�rNr+rTrir�r�r�s@r#rrs=����������#�#�K��O�0�
�$�
�
r&c�faa�]tRtRtoRtRtRt^(tRtRR/Rlt	R	t285R286tRtV3Rlt
R
tVtV;t#)ri-z5Mix-in class to handle each request in a new process.i,NT�blockingFc��VPfR#\VP4VP8�d8\P!R^4wr#VPPV4K[VPP4FQpV'd^M\Pp\P!W$4wr#VPPV4KS	R# \dTPP4K�\dK�i;i \d TPPT4K�\dK�i;i)z7Internal routine to wait for children that have exited.N�����)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr/rO�copy�WNOHANG)r"r��pid�_�flagss&$   r#�collect_children�ForkingMixIn.collect_children6s���#�#�+���d�*�*�+�t�/@�/@�@���Z�Z��A�.�F�C��(�(�0�0��5��+�+�0�0�2��287�!)�A�r�z�z�E��Z�Z��3�F�C��(�(�0�0��5�
3��)�1��(�(�.�.�0������)�6��(�(�0�0��5�����s<�4C�288A
D�%D�D�D�D�&E
�?E
�E
�E
c�&�VP4R#)z^Wait for zombies after self.timeout seconds of inactivity.289 290May be extended, do not override.291N�r�r*s&r#rI�ForkingMixIn.handle_timeoutY���292
�!�!�#r&c�&�VP4R#)z�Collect the zombie child processes regularly in the ForkingMixIn.293 294service_actions is called in the BaseServer's serve_forever loop.295Nr�r*s&r#r6�ForkingMixIn.service_actions`r�r&c�\�\P!4pV'dLVPf\4VnVPP	V4VPV4R#^pVP
W4^pVPV4\P!V4R# \dTPY4LHi;i \P!T4i;i TPT4\P!T4i \P!T4i;i;i)z-Fork a new subprocess to process the request.N)r�r
r�r7�addrir^rRrSrT�_exit)r"rVrWr��statuss&&&  r#rQ�ForkingMixIn.process_requestgs����'�'�)�C���'�'�/�+.�5�D�(��$�$�(�(��-��"�"�7�+����	)��'�'��@��F�)��-�-�g�6�����(��
!�?��%�%�g�>�?������(��)��-�-�g�6�����(������(�sH�,B)�C�)C�C&�C�C&�C#�&D+�(D�9D+�D(�(D+c�\<�\SV`4VPVPR7R#))r�N)�superrbr��block_on_close�r"�	__class__s&�r#rb�ForkingMixIn.server_close�s%����G� �"��!�!�4�+>�+>�!�?r&)r�)r�r�r�r�r�rFr�r�r�r�rIr6rQrbr�r��
__classcell__�r�r�s@@r#rr-sD����C���������!	�u�!	�F	$�	$�	)�2	@�	@r&c�Haa�]tRtRtoRtV3RltRtRtRtRt	Vt296V;t#)�_Threadsi�z*297Joinable list of all non-daemon threads.298c�n<�VP4VP'dR#\SV`
V4R#rz)�reap�daemonr��append)r"�threadr�s&&�r#r��_Threads.append�s$����	�	���=�=�=��
���v�r&c�$�.VR,uVR&pV#)�NNNr))r"�results& r#�pop_all�_Threads.pop_all�s���d�1�g���Q����
r&c�T�VP4FpVP4K	R#rz)r��join�r"r�s& r#r��
_Threads.join�s���l�l�n�F��K�K�M�%r&c��RV4VR&R#)c3�T"�TFqP4'gKVx�K 	R#5irz)�is_alive)�.0r�s& r#�	<genexpr>� _Threads.reap.<locals>.<genexpr>�s���B��f���0A�6�6��s�(�299(r�Nr)r*s&r#r��
_Threads.reap�s��B��B��Q�r&r))r�r�r�r�r�r�r�r�r�r�r�r�r�s@@r#r�r��s%��������C�Cr&r�c�0a�]tRtRtoRtRtRtRtVtR#)�300_NoThreadsi�z!301Degenerate version of _Threads.302c��R#rzr)r�s&&r#r��_NoThreads.append����r&c��R#rzr)r*s&r#r��_NoThreads.join�rr&r)N)	r�r�r�r�r�r�r�r�r�r�s@r#rr�s�����
�
�
r&rc�Xaa�]tRtRtoRtRtRt]!4tRt	Rt303V3RltRtVt
V;t#)	ri�z4Mix-in class to handle each request in a new thread.FTc��VPW4VPV4R# \dTPY4L1i;i TPT4i;i)zWSame as in BaseServer but as a thread.304 305In addition, exception handling is done here.306 307N)r^rRrSrTrUs&&&r#�process_request_thread�%ThreadingMixIn.process_request_thread�sU��	+�����8�
�!�!�'�*���	7����g�6�	7��
�!�!�'�*�s!�&�A�A�A�A�Ac�.�VP'd$\V4PR\44\P308!VPW3R7pVPVnVPPV4VP4R#)z*Start a new thread to process the request.�_threads)�targetr~N)r��vars�309setdefaultr�r�Threadr	�daemon_threadsr�rr��start)r"rVrW�ts&&& r#rQ�ThreadingMixIn.process_request�sj��������J�!�!�*�h�j�9����d�&A�&A�%,�$=�
?���&�&����
�
���Q��	���	r&c�X<�\SV`4VPP4R#rz)r�rbrr�r�s&�r#rb�ThreadingMixIn.server_close�s���
�����
�
���r&r))r�r�r�r�r�rr�rrr	rQrbr�r�r�r�s@@r#rr�s1����>��N��N��|�H�+���r&c��]tRtRtRtR#)ri�r)N�r�r�r�r�r�r)r&r#rr����Tr&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr�rr&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr�rr&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr�rr&c�.�]tRtRt]P310tRtR#)ri�r)N�r�r�r�r�rDrr�r�r)r&r#rr�������r&c�.�]tRtRt]P311tRtR#)ri�r)Nrr)r&r#rr�rr&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr����tr&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr����4r&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr�r"r&c��]tRtRtRtR#)ri�r)Nrr)r&r#rr�r$r&c�<a�]tRtRtoRtRtRtRtRtRt	Vt312R#)	r	i�ayBase class for request handler classes.313 314This class is instantiated for each request to be handled.  The315constructor sets the instance variables request, client_address316and server, and then calls the handle() method.  To implement a317specific service, all you need to do is to derive a class which318defines a handle() method.319 320The handle() method can find the request as self.request, the321client address as self.client_address, and the server (in case it322needs access to per-server information) as self.server.  Since a323separate instance is created for each request, the handle() method324can define other arbitrary instance variables.325 326c��WnW nW0nVP4VP	4VP4R# TP4i;irz)rVrW�server�setup�handle�finish)r"rVrWr)s&&&&r#r$�BaseRequestHandler.__init__�s<����,�����327�328��	��K�K�M��K�K�M��D�K�K�M�s�A�Ac��R#rzr)r*s&r#r*�BaseRequestHandler.setuprr&c��R#rzr)r*s&r#r+�BaseRequestHandler.handlerr&c��R#rzr)r*s&r#r,�BaseRequestHandler.finishrr&)rWrVr)N)r�r�r�r�r�r$r*r+r,r�r�r�s@r#r	r	�s#����� �
�
�
�
r&c�@a�]tRtRtoRtRt^tRtRtRt	Rt329RtVtR#)	r330iz4Define self.rfile and self.wfile for stream sockets.NFc�*�VPVnVPe&VPPVP4VP'd:VPP\P\PR4VPPRVP4VnVP^8Xd\VP4VnR#VPPRVP4VnR#)NT�rb�wb)rV�331connectionrF�332settimeout�disable_nagle_algorithmr�rD�IPPROTO_TCP�TCP_NODELAY�makefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler*s&r#r*�StreamRequestHandler.setup)s����,�,����<�<�#��O�O�&�&�t�|�|�4��'�'�'��O�O�&�&�v�'9�'9�'-�'9�'9�4�
A��_�_�-�-�d�D�M�M�B��333��=�=�A��&�t���7�D�J����1�1�$��
�
�F�D�Jr&c��VPP'gVPP4VPP4VPP4R# \PdLMi;irz)rB�closed�flushrD�errorr�r?r*s&r#r,�StreamRequestHandler.finish6sc���z�z� � � �
��334�335� � �"�336	
�337�338�����339�340������<�<�
��
�s�A.�.B�B)r8r?rBr�)
r�r�r�r�r�r>r@rFr:r*r,r�r�r�s@r#r341r342s3����>��H��H��G�$��G�	�	r&c�<a�]tRtRtoRtRtRtRtRtRt	Vt343R#)	rAiAz~Simple writable BufferedIOBase implementation for a socket344 345Does not hold data in a buffer, avoiding any need to call flush().c��WnR#rz��_sock)r"�socks&&r#r$�_SocketWriter.__init__Fs���346r&c��R#r�r)r*s&r#�writable�_SocketWriter.writableIs��r&c��VPPV4\V4;_uu_4pVPuuRRR4# +'giR#;irz)rL�sendall�347memoryview�nbytes)r"�b�views&& r#�write�_SocketWriter.writeLs2���348�349���1��
��]�]�d��;�;��]�]�]�s�A�A	c�6�VPP4#rz)rLr�r*s&r#r��_SocketWriter.filenoQs���z�z� � �"�"r&rKN)r�r�r�r�r�r$rPrXr�r�r�r�s@r#rArAAs$����J����350#�#r&rAc�0a�]tRtRtoRtRtRtRtVtR#)riTz6Define self.rfile and self.wfile for datagram sockets.c��^RIHpVPwVnVnV!VP4VnV!4VnR#)�)�BytesION)�ior_rV�packetrDr?rB)r"r_s& r#r*�DatagramRequestHandler.setupXs0���#'�<�<� ���T�[��T�[�[�)��351��Y��352r&c��VPPVPP4VP4R#rz)rD�sendtorB�getvaluerWr*s&r#r,�DatagramRequestHandler.finish^s)�������4�:�:�.�.�0�$�2E�2E�Fr&)rar?rDrBN)	r�r�r�r�r�r*r,r�r�r�s@r#rrTs����@��G�Gr&)	rrrrrr	r353rr)rrr)rrrr)'r��__version__rDr2r�rtrr`rrHr�__all__r��extendrr0�SelectSelectorrrrr�listr�rrrrrrrrrrrrr	r354rArr)r&r#�<module>rls���v�t����	�355���"�7���2�v����N�N�J�K�356�6�9����N�N�3�4��r�6������1�3N�O�P��9�n�%�%��,�,�O��.�.�O�j�j�ZE�357�E�P
�	�
�8�2�v���U@�U@�pC�t�C�,
�
�%�%�P�2�v���9�<��9�9�<��9�9���9�9���9�358�6�9���(�9�(�(�Y�(�L�N�4D�K�O�n�6H�O��r�6���K�l�4D�K�O��6H�O�#
�#
�\+�-�+�Z#�N�#�&G�/�Gr&
codekingpro/portable-devtools · Team Ai