eAoSrSSKrSSKrSSKrSSKrSSKr\"\S5(a\S- rSSKJr SSKJ r SSKJ r SS KJ r SS KJ r SS K Jr SS KJr S rS\S.SjjrS\S.Sjjr\"\S5(aS\S.SjjrS\S.Sjjr"SS\ R,5r"SS\\ R,5r"SS5r"SS5rg)) StreamReader StreamWriterStreamReaderProtocolopen_connection start_serverNAF_UNIX)open_unix_connectionstart_unix_server) coroutines)events) exceptions)format_helpers) protocols)logger)sleepi)limitc^ # [R"5n[X$S9n[XTS9m UR"U 4SjX40UD6IShvN upg[ UT XT5nXX4$N7f)aA wrapper for create_connection() returning a (reader, writer) pair. The reader returned is a StreamReader instance; the writer is a StreamWriter instance. The arguments are all the usual arguments to create_connection() except protocol_factory; most common are positional host and port, with various optional keyword arguments following. Additional optional keyword arguments are loop (to set the event loop instance to use) and limit (to set the buffer limit passed to the StreamReader). (If you want to customize the StreamReader and/or StreamReaderProtocol classes, just copy the code -- there's really nothing special here except some convenience.) rlooprc>T$Nprotocols5/opt/imh/python3.13/lib/python3.13/asyncio/streams.py!open_connection..1sN)r get_running_looprrcreate_connectionr) hostportrkwdsrreader transport_writerrs @rrrsi&  " " $D  1F#F6H//$.(,..LI )Xv .AAAAc^^^# [R"5mUUU4SjnTR"XQU40UD6IShvN $N7f)aVStart a socket server, call back for each client connected. The first parameter, `client_connected_cb`, takes two parameters: client_reader, client_writer. client_reader is a StreamReader object, while client_writer is a StreamWriter object. This parameter can either be a plain callback function or a coroutine; if it is a coroutine, it will be automatically converted into a Task. The rest of the arguments are all the usual arguments to loop.create_server() except protocol_factory; most common are positional host and port, with various optional keyword arguments following. The return value is the same as loop.create_server(). Additional optional keyword argument is limit (to set the buffer limit passed to the StreamReader). The return value is the same as loop.create_server(), i.e. a Server object which can be used to stop the service. c2>[TTS9n[UTTS9nU$Nrrrrr&rclient_connected_cbrrs rfactorystart_server..factoryNs&E5'0C-13r N)r r! create_server)r0r#r$rr%r1rs` ` @rrr6s;,  " " $D ##G4@4@ @@ @s5A?Ac^# [R"5n[XS9n[XCS9mUR"U4SjU40UD6IShvN upV[ UTXC5nXG4$N7f)z@Similar to `open_connection` but works with UNIX Domain Sockets.rrc>T$rrrsrr&open_unix_connection..bsHr N)r r!rrcreate_unix_connectionr) pathrr%rr&r'r(r)rs @rr r Zsi&&(E5':!88 d,&*,, i6@~,r*c^^^# [R"5mUUU4SjnTR"XA40UD6IShvN $N7f)z=Similar to `start_server` but works with UNIX Domain Sockets.c2>[TTS9n[UTTS9nU$r-r.r/s rr1"start_unix_server..factoryks&!D9F+F4G157HOr N)r r!create_unix_server)r0r8rr%r1rs` ` @rr r fs9&&(  ,,WCdCCCCs4A>Ac@\rSrSrSrS SjrSrSrSrSr S r S r g) FlowControlMixintaReusable flow control logic for StreamWriter.drain(). This implements the protocol methods pause_writing(), resume_writing() and connection_lost(). If the subclass overrides these it must call the super methods. StreamWriter.drain() must wait for _drain_helper() coroutine. NcUc"5UlOXlSUl[R "5UlSUlgNF)r get_event_loop_loop_paused collectionsdeque_drain_waiters_connection_lost)selfrs r__init__FlowControlMixin.__init__~s< <..0DJJ )//1 %r cUR(aeSUlURR5(a[R"SU5 gg)NTz%r pauses writing)rDrC get_debugrdebugrIs r pause_writingFlowControlMixin.pause_writings=<< ::   ! ! LL,d 3 "r cUR(deSUlURR5(a[R"SU5 UR H+nUR 5(aMURS5 M- g)NFz%r resumes writing)rDrCrMrrNrGdone set_resultrIwaiters rresume_writingFlowControlMixin.resume_writings`||| ::   ! ! LL-t 4))F;;==!!$'*r cSUlUR(dgURHAnUR5(aMUcUR S5 M0UR U5 MC gNT)rHrDrGrSrT set_exceptionrIexcrVs rconnection_lost FlowControlMixin.connection_lostsP $|| ))F;;==;%%d+((- *r cb# UR(a [S5eUR(dgURR 5nUR R U5 UIShvN UR RU5 gN !UR RU5 f=f7f)NzConnection lost)rHConnectionResetErrorrDrC create_futurerGappendremoverUs r _drain_helperFlowControlMixin._drain_helpers  &'89 9|| ))+ ""6* /LL    & &v .     & &v .s0A$B/'B,B -B1B/ BB,,B/c[er)NotImplementedErrorrIstreams r_get_close_waiter"FlowControlMixin._get_close_waiters!!r )rHrGrCrDr) __name__ __module__ __qualname____firstlineno____doc__rJrPrWr^rerk__static_attributes__rr rr>r>ts%&4 ( . /"r r>ct^\rSrSrSrSrSU4Sjjr\S5rSr Sr U4Sjr S r S r S rS rS rU=r$)ra)Helper class to adapt between Protocol and StreamReader. (This is a helper class instead of making StreamReader itself a Protocol subclass, because the StreamReader has other potential uses, and to prevent the user of the StreamReader to accidentally call inappropriate methods of the protocol.) Nc">[TU]US9 Ub-[R"U5UlUR UlOSUlUbXlSUlSUlSUl X l SUl URR5Ulg)NrF)superrJweakrefref_stream_reader_wr_source_traceback_strong_reader_reject_connection_task _transport_client_connected_cb _over_sslrCrb_closed)rI stream_readerr0r __class__s rrJStreamReaderProtocol.__init__s d#  $%,[[%?D "%2%D%DD "%)D "  *#0 "' $7!zz//1 r c>URcgUR5$r)ryrOs r_stream_reader#StreamReaderProtocol._stream_readers  ! ! )%%''r cXURnXlURS5SLUlg)N sslcontext)rCr~get_extra_infor)rIr'rs r_replace_transport'StreamReaderProtocol._replace_transports'zz#"11,?tKr c~^^TR(aPSS0nTR(aTRUS'TRRU5 TR 5 gTTlTR nUbURT5 TRS5SLTl TRb[TTUTR5nTRX45n[R"U5(aBUU4SjnTRRU5TlTRR!U5 STlgg)NmessagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.source_tracebackrc>UR5(aTR5 gUR5nUb0TRR SUTS.5 TR5 gg)Nz*Unhandled exception in client_connected_cb)r exceptionr') cancelledcloserrCcall_exception_handler)taskr]rIr's rcallback6StreamReaderProtocol.connection_made..callbacks_~~''!)..*C 99'S),)2; ") 'r )r|rzrCrabortr~r set_transportrrrrr iscoroutine create_taskr}add_done_callbackr{)rIr'contextr&r)resrs`` rconnection_made$StreamReaderProtocol.connection_mades  " "@G %%.2.D.D*+ JJ - -g 6 OO  #$$     +"11,?tK  $ $ 0!)T64::FF++F;C%%c** *"ZZ33C8  ,,X6"&D ) 1r cv>URnUb%UcUR5 OURU5 URR 5(d:UcURR S5 OURRU5 [ TU]U5 SUlSUl SUl SUl gr) rfeed_eofr[rrSrTrvr^ry_stream_writerr}r~)rIr]r&rs rr^$StreamReaderProtocol.connection_losts$$  {!$$S)||  ""{ ''- **3/ $!%" r cFURnUbURU5 ggr)r feed_data)rIdatar&s r data_received"StreamReaderProtocol.data_receiveds&$$     T " r cfURnUbUR5 UR(agg)NFT)rrr)rIr&s r eof_received!StreamReaderProtocol.eof_receiveds,$$   OO  >>r cUR$r)rris rrk&StreamReaderProtocol._get_close_waiter&s ||r cURnUR5(a'UR5(dUR5 ggg![a gf=fr)rrSrrAttributeError)rIcloseds r__del__StreamReaderProtocol.__del__)sR #\\F{{}}V%5%5%7%7  "&8}   s A AA) rrrr|rzryrr{r}r~NN)rmrnrorprqrzrJpropertyrrrr^rrrkrrr __classcell__)rs@rrrsS2&(( L %'N$#  # #r rc\rSrSrSrSrSr\S5rSr Sr Sr S r S r S rS rSSjrSrS S S S.Sjr\4SjrSrg )ri5aWraps a Transport. This exposes write(), writelines(), [can_]write_eof(), get_extra_info() and close(). It adds drain() which returns an optional Future on which you can wait for flow control. It also adds a transport property which references the Transport directly. cXlX lUb[U[5(deX0lX@lUR R 5UlURRS5 gr) r~ _protocol isinstancer_readerrCrb _complete_futrT)rIr'rr&rs rrJStreamWriter.__init__?sV#!~FL!A!AAA  !ZZ557 %%d+r cURRSUR<3/nURbUR SUR<35 SR SR U55$)N transport=zreader=<{}> )rrmr~rrcformatjoinrIinfos r__repr__StreamWriter.__repr__Is['':doo5H)IJ << # KK'$,,!12 3}}SXXd^,,r cUR$rr~rOs rr'StreamWriter.transportOs r c:URRU5 gr)r~writerIrs rrStreamWriter.writeSs d#r c:URRU5 gr)r~ writelinesrs rrStreamWriter.writelinesVs ""4(r c6URR5$r)r~ write_eofrOs rrStreamWriter.write_eofYs((**r c6URR5$r)r~ can_write_eofrOs rrStreamWriter.can_write_eof\s,,..r c6URR5$r)r~rrOs rrStreamWriter.close_s$$&&r c6URR5$r)r~ is_closingrOs rrStreamWriter.is_closingbs))++r cV# URRU5IShvN gN7fr)rrkrOs r wait_closedStreamWriter.wait_closedesnn..t444s )')Nc8URRX5$r)r~r)rInamedefaults rrStreamWriter.get_extra_infohs--d<B?BB)server_hostnamessl_handshake_timeoutssl_shutdown_timeoutc # URRSLnURnUR5IShvN URR UR XaXRUUS9IShvN nXplUR U5 gNKN7f)z3Upgrade an existing stream-based connection to TLS.N) server_siderrr)rrrrC start_tlsr~r)rIrrrrrr new_transports rrStreamWriter.start_tlss nn99E >>jjl"jj22 OOX#"7!5 377 (##M2 7s!8B B.B )B*B B cURR5(dcURR5(aUR"S[ 5 gUR 5 UR"SU<3[ 5 gg)Nzloop is closedz unclosed )r~rrC is_closedwarnResourceWarningr)rIwarningss rrStreamWriter.__del__sZ))++zz##%% .@  $2OD ,r )rrCrrr~r)rmrnrorprqrJrrr'rrrrrrrrrrrrrrrr rrr5sm,- $)+/',5=-4)-.2-13 (Er rc\rSrSrSr\S4SjrSrSrSr Sr Sr S r S r S rS rS rSrSSjrSSjrSrSrSrSrg)riNc|US::a [S5eXlUc[R"5UlOX l[ 5UlSUlSUlSUl SUl SUl URR5(a0[R"[R "S55Ulgg)NrzLimit cannot be <= 0Fr ) ValueError_limitr rBrC bytearray_buffer_eof_waiter _exceptionr~rDrMr extract_stacksys _getframerz)rIrrs rrJStreamReader.__init__s A:34 4 <..0DJJ {    ::   ! !%3%A%A a &"D " "r cS/nUR(a'UR[UR5S35 UR(aURS5 UR[ :waURSUR35 UR (aURSUR <35 UR(aURSUR<35 UR(aURSUR<35 UR(aURS5 S RS RU55$) Nrz byteseofzlimit=zwaiter=z exception=rpausedrr) rrclenrr_DEFAULT_LIMITrrr~rDrrrs rrStreamReader.__repr__s << KK3t||,-V4 5 99 KK  ;;. ( KK& . / << KK'$,,!12 3 ?? KK*T__$78 9 ?? KK*T__$78 9 << KK !}}SXXd^,,r cUR$r)rrOs rrStreamReader.exceptions r cXlURnUb/SUlUR5(dURU5 gggr)rrrr[r\s rr[StreamReader.set_exceptionsD  DL##%%$$S)& r cURnUb/SUlUR5(dURS5 ggg)z1Wakeup read*() functions waiting for data or EOF.N)rrrTrUs r_wakeup_waiterStreamReader._wakeup_waiters?  DL##%%!!$'& r c8URbS5eXlg)NzTransport already setr)rIr's rrStreamReader.set_transports&?(??&#r cUR(aF[UR5UR::a"SUlURR 5 gggrA)rDrrrr~resume_readingrOs r_maybe_resume_transport$StreamReader._maybe_resume_transports; <U nU nMD UbO[SUS-U- 5nX@R:a[R"SU5eUR(aF[UR 5n UR R5 [R"U S5eUR!S 5IShvN GMX`R:a[R"S U5eUR SUn UR SU2 UR#5 [U 5$Nf7f) aRead data from the stream until ``separator`` is found. On success, the data and separator will be removed from the internal buffer (consumed). Returned data will include the separator at the end. Configured stream limit is used to check result. Limit sets the maximal length of data that can be returned, not counting the separator. If an EOF occurs and the complete separator is still not found, an IncompleteReadError exception will be raised, and the internal buffer will be reset. The IncompleteReadError.partial attribute may contain the separator partially. If the data cannot be read because of over limit, a LimitOverrunError exception will be raised, and the data will be left in the internal buffer, so it can be read again. The ``separator`` may also be a tuple of separators. In this case the return value will be the shortest possible that has any separator as the suffix. For the purposes of LimitOverrunError, the shortest possible separator is considered to be the one that matched. )keyz-Separator should contain at least one elementrz,Separator should be at least one-byte stringNr z2Separator is not found, and chunk exceed the limitr&z2Separator is found, but chunk is longer than limit)rtuplesortedrrrrfindmaxrrr)rbytesr,r'r"r) rI separator min_seplen max_seplenoffsetbuflen match_start match_endr.isependchunks rr&StreamReader.readuntil>s4 i ' 'yc2I" ILM M1& 2' ?KL L ?? &// !*&F*,"  $C<<,,S9Drz#SXo$,(+I*.K%(Q Z 78KK'$66L  yydll+ ""$ 44UDAA%%k2 2 2OR  $..DkS S Zi( LL) $ $$&U| 3s CG>G>&B/G>G<A'G>c# URb UReUS:XagUS:aR/nURUR5IShvN nU(dOURU5 M>SR U5$UR (d*UR (dURS5IShvN [[UR 5SU5nUR SU2 UR5 U$NNH7f)a]Read up to `n` bytes from the stream. If `n` is not provided or set to -1, read until EOF, then return all read bytes. If EOF was received and the internal buffer is empty, return an empty bytes object. If `n` is 0, return an empty bytes object immediately. If `n` is positive, return at most `n` available bytes as soon as at least 1 byte is available in the internal buffer. If EOF is received before any byte is read, return an empty bytes object. Returned value is not limited with limit, configured at stream creation. If stream was paused, this function will automatically resume it if needed. Nrr read) rrHrrcrrrr"r; memoryviewr)rInblocksblockrs rrHStreamReader.reads, ?? &// ! 6 q5 F"ii 44 e$  88F# #||DII%%f- - -Z -bq12 LL!  $$& 5 .s&AC< C8 A&C<1C:2AC<:C<c# US:a [S5eURb UReUS:Xag[UR5U:aUR(aE[ UR5nURR 5 [R"X!5eURS5IShvN [UR5U:aM[UR5U:Xa0[ UR5nURR 5 O0[ [UR5SU5nURSU2 UR5 U$N7f)aRead exactly `n` bytes. Raise an IncompleteReadError if EOF is reached before `n` bytes can be read. The IncompleteReadError.partial attribute of the exception will contain the partial read bytes. if n is zero, return empty bytes object. Returned value is not limited with limit, configured at stream creation. If stream was paused, this function will automatically resume it if needed. rz*readexactly size can not be less than zeroNr readexactly) rrrrrr;r,rr'r"rIr)rIrJ incompleters rrOStreamReader.readexactlys q5IJ J ?? &// ! 6$,,!#yy"4<<0  ""$ 44ZCC%%m4 4 4 $,,!# t||  !&D LL   DLL1"156D RaR  $$&  5sB5E$7E"8E$B E$cU$rrrOs r __aiter__StreamReader.__aiter__ s r cZ# UR5IShvN nUS:Xa[eU$N7f)Nr )r2StopAsyncIteration)rIvals r __anext__StreamReader.__anext__s*MMO# #:$ $ $s +)+) rrrrrCrDrzr~r)r%)r6)rmrnrorprzrrJrrr[r rrrrrr"r2r&rHrOrSrXrrrr rrrsf+$",-$*($- .$, 8>pd1f'Rr rrr)__all__rEsocketrrrwhasattrr r rrrlogrtasksrrrrr r Protocolr>rrrrr rras '  69 <