+
     Bi׼                        Rt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	 ^ RI
t
^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^R	IHt ^R
IHt ]! ]P                  R4      t]'       d    ]P2                  ! R4      tR t ! R R ]P:                  4      t ! R R]P>                  ]P@                  4      t! ! R R]!4      t" ! R R]!]PF                  4      t$R#   ] d    Rt
 Li ; i  ] d    Rt Lui ; i)BaseSelectorEventLoopN)base_events)	constants)events)futures)	protocols)sslproto)
transports)trsock)loggersendmsg
SC_IOV_MAXFc                      V P                  V4      p\        VP                  V,          4      #   \         d     R # i ; i)F)get_keyboolr   KeyError)selectorfdeventkeys   &&& ./usr/lib/python3.14/asyncio/selector_events.py_test_selector_eventr   *   sA    (r" CJJ&''  s   / >>c                   F  a a ] tR t^5t oR6V 3R lltR6RRRR/R lltR6RRRRRRRRR	]P                  R
]P                  /R llt	R7R lt
V 3R ltR tR tR tR tR tRR^d]P                  ]P                  3R ltRR^d]P                  ]P                  3R ltRR]P                  ]P                  3R ltR tR tR tR tR tR tR tR tR tR tR6R  ltR! tR" t R# t!R$ t"R% t#R8R& lt$R' t%R( t&R) t'R* t(R+ t)R, t*R- t+R6R. lt,R/ t-R0 t.R1 t/R2 t0R3 t1R4 t2R5t3Vt4V ;t5# )9r   Nc                  < \         SV `  4        Vf   \        P                  ! 4       p\        P
                  ! RVP                  P                  4       Wn        V P                  4        \        P                  ! 4       V n        R # )NzUsing selector: %s)super__init__	selectorsDefaultSelectorr   debug	__class____name__	_selector_make_self_pipeweakrefWeakValueDictionary_transports)selfr   r   s   &&r   r   BaseSelectorEventLoop.__init__;   s_     002H)8+=+=+F+FG!"668    extraserverc               >    V P                  V4       \        WW#WE4      # N)_ensure_fd_no_transport_SelectorSocketTransport)r&   sockprotocolwaiterr)   r*   s   &&&&$$r   _make_socket_transport,BaseSelectorEventLoop._make_socket_transportE   s$    $$T*'H(-7 	7r(   server_sideFserver_hostnamessl_handshake_timeoutssl_shutdown_timeoutc                   V P                  V4       \        P                  ! WW4WVV	V
R 7      p\        WVWxR7       VP                  # ))r6   r7   )r)   r*   )r-   r   SSLProtocolr.   _app_transport)r&   rawsockr0   
sslcontextr1   r4   r5   r)   r*   r6   r7   ssl_protocols   &&&&&$$$$$$ r   _make_ssl_transport)BaseSelectorEventLoop._make_ssl_transportK   sM     	$$W-++J"7!5	
 	!',	=***r(   c                @    V P                  V4       \        WVW4V4      # r,   )r-   _SelectorDatagramTransport)r&   r/   r0   addressr1   r)   s   &&&&&&r   _make_datagram_transport.BaseSelectorEventLoop._make_datagram_transport]   s(    $$T*)$h*15B 	Br(   c                  < V P                  4       '       d   \        R 4      hV P                  4       '       d   R# V P                  4        \        SV `  4        V P                  e$   V P                  P                  4        RV n        R# R# )z!Cannot close a running event loopN)
is_runningRuntimeError	is_closed_close_self_piper   closer!   r&   r   s   &r   rJ   BaseSelectorEventLoop.closec   sg    ??BCC>>>>%NN  "!DN &r(   c                   V P                  V P                  P                  4       4       V P                  P                  4        R V n        V P                  P                  4        R V n        V ;P
                  ^,          un        R # r,   )_remove_reader_ssockfilenorJ   _csock_internal_fdsr&   s   &r   rI   &BaseSelectorEventLoop._close_self_pipen   s\    DKK..01ar(   c                P   \         P                  ! 4       w  V n        V n        V P                  P	                  R 4       V P                  P	                  R 4       V ;P
                  ^,          un        V P                  V P                  P                  4       V P                  4       R# )FN)	socket
socketpairrO   rQ   setblockingrR   _add_readerrP   _read_from_selfrS   s   &r   r"   %BaseSelectorEventLoop._make_self_pipev   sq    #)#4#4#6 T[&&a++-t/C/CDr(   c                    R # r,    r&   datas   &&r   _process_self_data(BaseSelectorEventLoop._process_self_data~   s    r(   c                      V P                   P                  R4      pV'       g   R# V P                  V4       K:    \         d     KH  \         d     R# i ; i)Ti   N)rO   recvr`   InterruptedErrorBlockingIOErrorr^   s   & r   rZ   %BaseSelectorEventLoop._read_from_self   sO    {{''-''-# " s   "; ; A	AAAc                    V P                   pVf   R #  VP                  R4       R #   \         d2    T P                  '       d   \        P
                  ! RRR7        R #  R # i ; i)N    z3Fail to write a null byte into the self-pipe socketTexc_info)rQ   sendOSError_debugr   r   )r&   csocks   & r   _write_to_self$BaseSelectorEventLoop._write_to_self   s\     =	,JJu 	,{{{ 0&*, , 	,s   ' A#A#"A#c                b    V P                  VP                  4       V P                  WW4VWg4	       R # r,   )rY   rP   _accept_connection)r&   protocol_factoryr/   r<   r*   backlogr6   r7   s   &&&&&&&&r   _start_serving$BaseSelectorEventLoop._start_serving   s-     	(?(?)W.	Fr(   c                (   \        V^,           4       Fz  p VP                  4       w  rV P                  '       d   \        P                  ! RWJV	4       V	P                  R4       RV
/pV P                  WWVWg4      pV P                  V4       K|  	  R#   \         d     K  \        \        3 d      R# \         d   pTP                  \        P                  \        P                  \        P                  \        P                   39   d   T P#                  RRRTR\$        P&                  ! T4      /4       T P)                  TP+                  4       4       T P-                  \.        P0                  T P2                  YY4YVT4	        Rp?EKx  h Rp?ii ; i)	   z#%r got a new connection from %r: %rFpeernameNmessagez&socket.accept() out of system resource	exceptionrV   )rangeacceptrm   r   r   rX   _accept_connection2create_taskConnectionAbortedErrorre   rd   rl   errnoEMFILEENFILEENOBUFSENOMEMcall_exception_handlerr
   TransportSocketrN   rP   
call_laterr   ACCEPT_RETRY_DELAYru   )r&   rs   r/   r<   r*   rt   r6   r7   _connaddrr)   r}   excs   &&&&&&&&      r   rr   (BaseSelectorEventLoop._accept_connection   s^    w{#A&)![[]
;;;LL!F!'t5  ': $T*11$Ev)A   (O $ * #%56   99u||!&!> >
 //!#K#S &"8"8">1 
 ''6OOI$@$@$($7$7$4J$+$8	: : 's7   ABF!F0F5F>F?CFFFc                  "   R pR p	 V! 4       pV P                  4       p
V'       d   V P                  W(WJRW5VVR7	      p	MV P                  W(WVR7      p	 V
G R j  xL
  R #  L  \         d    T	P	                  4        R p
h i ; i  \
        \        3 d    h \         dK   pT P                  '       d.   RRRT/pTe   YR&   T	e   YR&   T P                  T4        R p?R #  R p?R # R p?ii ; i5i)	NT)r1   r4   r)   r*   r6   r7   )r1   r)   r*   rz   z3Error on transport creation for incoming connectionr{   r0   	transport)	create_futurer>   r2   BaseExceptionrJ   
SystemExitKeyboardInterruptrm   r   )r&   rs   r   r)   r<   r*   r6   r7   r0   r   r1   r   contexts   &&&&&&&&     r   r~   )BaseSelectorEventLoop._accept_connection2   s    
 	&	5')H'')F 44J $E*?)=	 5 ?	 !776! 8 #	  !  -. 	 	5{{{M
 '*2J'(+4K(++G44 	5sY   C-AB A" A A" C- A" "BB C*C* 9C%C-%C**C-c                Z   Tp\        V\        4      '       g    \        VP                  4       4      pV P                  P                  V4      pV'       d,   VP                  4       '       g   \        RV: RV: 24      hR# R#   \        \        \
        3 d    \        R T: 24      Rhi ; i)zInvalid file object: NzFile descriptor z is used by transport )

isinstanceintrP   AttributeError	TypeError
ValueErrorr%   get
is_closingrG   )r&   r   rP   r   s   &&  r   r-   -BaseSelectorEventLoop._ensure_fd_no_transport  s    &#&&KV]]_- $$((0	Y1133"2&(>-!" " 49	 #Iz: K #8!?@dJKs   B 'B*c                   V P                  4        \        P                  ! W#V R 4      pV P                  P	                  4       P                  V4      pVf0   V P                  P                  V\        P                  VR 34       V# VP                  VP                  upw  rxV P                  P                  W\        P                  ,          WH34       Ve   VP                  4        V# r,   )_check_closedr   Handler!   get_mapr   registerr   
EVENT_READr_   modifycancel	r&   r   callbackargshandler   maskreaderwriters	   &&&*     r   rY   !BaseSelectorEventLoop._add_reader  s    xtT:nn$$&**2.;NN##B	(<(<%+TN4  &)ZZ"D"6NN!!"Y-A-A&A#)"24!r(   c                   V P                  4       '       d   R # V P                  P                  4       P                  V4      pVf   R # VP                  VP
                  upw  rEV\        P                  ( ,          pV'       g   V P                  P                  V4       MV P                  P                  WRV34       Ve   VP                  4        R# R # FNT)rH   r!   r   r   r   r_   r   r   
unregisterr   r   r&   r   r   r   r   r   s   &&    r   rN   $BaseSelectorEventLoop._remove_reader%  s    >>nn$$&**2.;!$SXXv%%%%NN%%b)NN!!"T6N;MMOr(   c                   V P                  4        \        P                  ! W#V R 4      pV P                  P	                  4       P                  V4      pVf0   V P                  P                  V\        P                  R V34       V# VP                  VP                  upw  rxV P                  P                  W\        P                  ,          Wt34       Ve   VP                  4        V# r,   )r   r   r   r!   r   r   r   r   EVENT_WRITEr_   r   r   r   s	   &&&*     r   _add_writer!BaseSelectorEventLoop._add_writer8  s    xtT:nn$$&**2.;NN##B	(=(=%)6N4  &)ZZ"D"6NN!!"Y-B-B&B#)"24!r(   c                   V P                  4       '       d   R # V P                  P                  4       P                  V4      pVf   R # VP                  VP
                  upw  rEV\        P                  ( ,          pV'       g   V P                  P                  V4       MV P                  P                  WVR34       Ve   VP                  4        R# R # r   )rH   r!   r   r   r   r_   r   r   r   r   r   r   s   &&    r   _remove_writer$BaseSelectorEventLoop._remove_writerG  s    >>nn$$&**2.;!$SXXv&&&&NN%%b)NN!!"VTN;MMOr(   c                P    V P                  V4       V P                  ! W.VO5!   R # r,   )r-   rY   r&   r   r   r   s   &&&*r   
add_reader BaseSelectorEventLoop.add_reader\  #    $$R(--r(   c                F    V P                  V4       V P                  V4      # r,   )r-   rN   r&   r   s   &&r   remove_reader#BaseSelectorEventLoop.remove_readera  !    $$R(""2&&r(   c                P    V P                  V4       V P                  ! W.VO5!   R # r,   )r-   r   r   s   &&&*r   
add_writer BaseSelectorEventLoop.add_writerf  r   r(   c                F    V P                  V4       V P                  V4      # r,   )r-   r   r   s   &&r   remove_writer#BaseSelectorEventLoop.remove_writerk  r   r(   c                   "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      h VP                  V4      #   \        \        3 d     Mi ; iT P                  4       pTP                  4       pT P                  T4       T P                  Y@P                  Y1T4      pTP                  \        P                  ! T P                   YER7      4       TG Rj  xL 
 # 5i    the socket must be non-blockingr   N)r   _check_ssl_socketrm   
gettimeoutr   rc   re   rd   r   rP   r-   rY   
_sock_recvadd_done_callback	functoolspartial_sock_read_done)r&   r/   nfutr   r   s   &&&   r   	sock_recvBaseSelectorEventLoop.sock_recvp  s      	%%d+;;;4??,1>??	99Q<!12 		  "[[]$$R(!!"oos!Dd22BF	Hyy7   A	C>A C>A1.C>0A11BC>8C;9C>c                `    Ve   VP                  4       '       g   V P                  V4       R # R # r,   )	cancelledr   r&   r   r   r   s   &&&&r   r   %BaseSelectorEventLoop._sock_read_done  (    >!1!1!3!3r" "4r(   c                   VP                  4       '       d   R #  VP                  V4      pVP                  V4       R #   \        \        3 d     R # \
        \        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )	donerc   
set_resultre   rd   r   r   r   set_exception)r&   r   r/   r   r_   r   s   &&&&  r   r    BaseSelectorEventLoop._sock_recv  sw     88::		!99Q<D NN4   !12 	-. 	 	#c""	#'   > B	B	!
B	,B	-BB	c                   "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      h VP                  V4      #   \        \        3 d     Mi ; iT P                  4       pTP                  4       pT P                  T4       T P                  Y@P                  Y1T4      pTP                  \        P                  ! T P                   YER7      4       TG Rj  xL 
 # 5ir   )r   r   rm   r   r   	recv_intore   rd   r   rP   r-   rY   _sock_recv_intor   r   r   r   )r&   r/   bufr   r   r   s   &&&   r   sock_recv_into$BaseSelectorEventLoop.sock_recv_into  s      	%%d+;;;4??,1>??	>>#&&!12 		  "[[]$$R(!!"&:&:CsKd22BF	Hyyr   c                   VP                  4       '       d   R #  VP                  V4      pVP                  V4       R #   \        \        3 d     R # \
        \        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )	r   r   r   re   rd   r   r   r   r   )r&   r   r/   r   nbytesr   s   &&&&  r   r   %BaseSelectorEventLoop._sock_recv_into  sx     88::		#^^C(F NN6"  !12 	-. 	 	#c""	#r   c                   "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      h VP                  V4      #   \        \        3 d     Mi ; iT P                  4       pTP                  4       pT P                  T4       T P                  Y@P                  Y1T4      pTP                  \        P                  ! T P                   YER7      4       TG Rj  xL 
 # 5ir   )r   r   rm   r   r   recvfromre   rd   r   rP   r-   rY   _sock_recvfromr   r   r   r   )r&   r/   bufsizer   r   r   s   &&&   r   sock_recvfrom#BaseSelectorEventLoop.sock_recvfrom  s      	%%d+;;;4??,1>??	==))!12 		  "[[]$$R(!!"&9&93gNd22BF	Hyyr   c                   VP                  4       '       d   R #  VP                  V4      pVP                  V4       R #   \        \        3 d     R # \
        \        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )	r   r   r   re   rd   r   r   r   r   )r&   r   r/   r   resultr   s   &&&&  r   r   $BaseSelectorEventLoop._sock_recvfrom  sx     88::		#]]7+F NN6"  !12 	-. 	 	#c""	#r   c                (  "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      hV'       g   \        V4      p VP                  W#4      #   \        \        3 d     Mi ; iT P                  4       pTP                  4       pT P                  T4       T P                  YPP                  YATT4      pTP                  \        P                   ! T P"                  YVR7      4       TG Rj  xL 
 # 5ir   )r   r   rm   r   r   lenrecvfrom_intore   rd   r   rP   r-   rY   _sock_recvfrom_intor   r   r   r   )r&   r/   r   r   r   r   r   s   &&&&   r   sock_recvfrom_into(BaseSelectorEventLoop.sock_recvfrom_into  s      	%%d+;;;4??,1>??XF	%%c22!12 		  "[[]$$R(!!"&>&>3"(*d22BF	Hyys=   ADDA0 /D0BDBBDDDc                   VP                  4       '       d   R #  VP                  W44      pVP                  V4       R #   \        \        3 d     R # \
        \        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )	r   r   r   re   rd   r   r   r   r   )r&   r   r/   r   r   r   r   s   &&&&&  r   r   )BaseSelectorEventLoop._sock_recvfrom_into  sz     88::		#''5F NN6"  !12 	-. 	 	#c""	#r   c           	     @  "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      h VP                  V4      pV\        V4      8X  d   R# V P                  4       pVP                  4       pV P                  V4       V P                  WPP                  WA\        V4      V.4      pVP                  \         P"                  ! V P$                  WVR7      4       VG Rj  xL
 #   \        \        3 d    ^ p Li ; i L5i)r   r   Nr   )r   r   rm   r   r   rk   re   rd   r   r   rP   r-   r   _sock_sendall
memoryviewr   r   r   _sock_write_done)r&   r/   r_   r   r   r   r   s   &&&    r   sock_sendall"BaseSelectorEventLoop.sock_sendall  s      	%%d+;;;4??,1>??			$A D	>  "[[]$$R(!!"&8&8#",T"2QC9d33RG	Iy  !12 	A	 s7   A	DD B!D>D?DDDDDc                j   VP                  4       '       d   R # V^ ,          p VP                  W5R  4      pYV,          pT\        T4      8X  d   TP                  R 4       R # YT^ &   R #   \        \        3 d     R # \        \
        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )
r   rk   re   rd   r   r   r   r   r   r   )r&   r   r/   viewposstartr   r   s   &&&&&   r   r  #BaseSelectorEventLoop._sock_sendall1  s    88::A			$v,'A 	
CINN4 F  !12 	-. 	 	c"	s)   A' 'B2;B2

B2B2B--B2c                  "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      h VP                  W#4      #   \        \        3 d     Mi ; iT P                  4       pTP                  4       pT P                  T4       T P                  YPP                  YATT4      pTP                  \        P                  ! T P                   YVR7      4       TG Rj  xL 
 # 5ir   )r   r   rm   r   r   sendtore   rd   r   rP   r-   r   _sock_sendtor   r   r   r  )r&   r/   r_   rB   r   r   r   s   &&&&   r   sock_sendto!BaseSelectorEventLoop.sock_sendtoG  s      	%%d+;;;4??,1>??	;;t--!12 		   "[[]$$R(!!"&7&7D")+d33RG	Iyys7   A	C?A C?A1.C?0A11BC?9C<:C?c                   VP                  4       '       d   R #  VP                  V^ V4      pVP                  V4       R #   \        \        3 d     R # \
        \        3 d    h \         d   pTP                  T4        R p?R # R p?ii ; ir,   )	r   r  r   re   rd   r   r   r   r   )r&   r   r/   r_   rB   r   r   s   &&&&&  r   r  "BaseSelectorEventLoop._sock_sendtob  sz    88::		D!W-A NN1  !12 	-. 	 	#c""	#s)   A   BB#
B.B/BBc                H  "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      hVP
                  \        P                  8X  g6   \         P                  '       di   VP
                  \        P                  8X  dJ   V P                  W!P
                  VP                  VP                  V R7      G Rj  xL
 pV^ ,          w     rBV P                  4       pV P                  WQV4        VG Rj  xL
 Rp#  LA L  Rpi ; i5i)r   r   )familytypeprotoloopN)r   r   rm   r   r   r  rV   AF_INET	_HAS_IPv6AF_INET6_ensure_resolvedr  r  r   _sock_connect)r&   r/   rB   resolvedr   r   s   &&&   r   sock_connect"BaseSelectorEventLoop.sock_connectq  s     
 	%%d+;;;4??,1>??;;&..(%%%$++*H!22$))4:: 3  H #+1+Aq!Q  "3g.	9 C  CsC   A=D" AD"D4D"D DD D"D DD"c           	        VP                  4       p VP                  V4       VP                  R 4       R pR #   \        \        3 dc    T P                  T4       T P                  Y@P                  YT4      pTP                  \        P                  ! T P                  YER7      4        Lv\        \        3 d    h \         d   pTP                  T4        R p?LR p?ii ; i  R pi ; i)Nr   )rP   connectr   re   rd   r-   r   _sock_connect_cbr   r   r   r  r   r   r   r   )r&   r   r/   rB   r   r   r   s   &&&&   r   r  #BaseSelectorEventLoop._sock_connect  s    [[]	LL!  NN4 C#  !12 		M
 ((,%%))3g?F!!!!$"7"7KM-. 	 	#c""	#
 CsE   8 C# A0C (C# *C 9
C C CC# C  C# #C'c                `    Ve   VP                  4       '       g   V P                  V4       R # R # r,   )r   r   r   s   &&&&r   r  &BaseSelectorEventLoop._sock_write_done  r   r(   c                   VP                  4       '       d   R #  VP                  \        P                  \        P                  4      pV^ 8w  d   \        VRV 24      h VP                  R 4       R pR #   \        \        3 d     L\        \        3 d    h \         d   pTP                  T4        R p?LHR p?ii ; i  R pi ; i)NzConnect call failed )r   
getsockoptrV   
SOL_SOCKETSO_ERRORrl   r   re   rd   r   r   r   r   )r&   r   r/   rB   errr   s   &&&&  r   r#  &BaseSelectorEventLoop._sock_connect_cb  s    88::	//&"3"3V__ECaxc%9'#CDD  NN4 C  !12 	-. 	 	#c""	#
 CsH   AA4 C  4B=C  B=
B=!B="B83C  8B==C   Cc                   "   \         P                  ! V4       V P                  '       d!   VP                  4       ^ 8w  d   \	        R4      hV P                  4       pV P                  W!4       VG Rj  xL
 #  L5i)r   r   N)r   r   rm   r   r   r   _sock_accept)r&   r/   r   s   && r   sock_accept!BaseSelectorEventLoop.sock_accept  s^      	%%d+;;;4??,1>??  "#$yys   A/A81A62A8c           	        VP                  4       p VP                  4       w  rEVP                  R 4       VP                  WE34       R#   \        \
        3 dc    T P                  T4       T P                  Y0P                  Y4      pTP                  \        P                  ! T P                  Y6R7      4        R# \        \        3 d    h \         d   pTP!                  T4        Rp?R# Rp?ii ; i)Fr   N)rP   r}   rX   r   re   rd   r-   rY   r.  r   r   r   r   r   r   r   r   )r&   r   r/   r   r   rB   r   r   s   &&&     r   r.  "BaseSelectorEventLoop._sock_accept  s    [[]	, KKMMDU# NND?+  !12 	L((,%%b*;*;SGF!!!!$"6"6JL-. 	 	#c""	#s*   #A	 	A/C2;C2

C2C2C--C2c                
  "   V P                   VP                   VP                  4       pVP                  4        VP	                  4       G R j  xL
   V P                  VP                  W#VRR7      G R j  xL
 VP                  4        V'       d   VP                  4        WP                   VP                  &   #  Ll LF  TP                  4        T'       d   TP                  4        YP                   TP                  &   i ; i5i)NF)fallback)	r%   _sock_fd
is_readingpause_reading_make_empty_waitersock_sendfile_sock_reset_empty_waiterresume_reading)r&   transpfileoffsetcountr<  s   &&&&& r   _sendfile_native&BaseSelectorEventLoop._sendfile_native  s     V__-**,'')))	7++FLL$5: , < < &&(%%'06V__- 	*< &&(%%'06V__-s>   ADB:D"B> 5B<6B> 9AD<B> >AD  Dc                   V F  w  r#VP                   VP                  upw  rVV\        P                  ,          '       d:   Ve6   VP                  '       d   V P                  V4       MV P                  V4       V\        P                  ,          '       g   K  Vf   K  VP                  '       d   V P                  V4       K  V P                  V4       K  	  R # r,   )	fileobjr_   r   r   
_cancelledrN   _add_callbackr   r   )r&   
event_listr   r   rD  r   r   s   &&     r   _process_events%BaseSelectorEventLoop._process_events  s    #IC(+SXX%G%fi****v/A$$$''0&&v.i++++0B$$$''0&&v. $r(   c                d    V P                  VP                  4       4       VP                  4        R # r,   )rN   rP   rJ   )r&   r/   s   &&r   _stop_serving#BaseSelectorEventLoop._stop_serving  s    DKKM*

r(   )rQ   r!   rO   r%   r,   NNN)r   )6r    
__module____qualname____firstlineno__r   r2   r   SSL_HANDSHAKE_TIMEOUTSSL_SHUTDOWN_TIMEOUTr>   rC   rJ   rI   r"   r`   rZ   ro   ru   rr   r~   r-   rY   rN   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r#  r/  r.  rA  rH  rK  __static_attributes____classdictcell____classcell__r   __classdict__s   @@r   r   r   5   s    97%)7267+ +26+ +  $+ #,"A"A	+
 "+!?!?+$B	" E
,& #'tS-6-L-L,5,J,JF D#"+"A"A!*!?!?	0)h D"+"A"A!*!?!?	-5^"&*.
'
.
'
,#! *#".#"2#">,62.#*,"7/ r(   c                      a a ] tR tRt oRtRtRV 3R lltR tR tR t	R t
R tR	 tR
 tR tR t]P"                  3R ltRR ltR tR tR tR tRtVtV ;t# )_SelectorTransporti  Nc                  < \         SV `  WA4       \        P                  ! V4      V P                  R &    VP                  4       V P                  R&   RV P                  9  d    VP                  4       V P                  R&   W n
        VP                  4       V n        RV n        V P                  V4       WPn        \         P"                  ! 4       V n        ^ V n        RV n        RV n        V P                  e   V P                  P-                  V 4       WP.                  V P                  &   R#   \         d    RT P                  R&    Li ; i  \        P                   d    RT P                  R&    Li ; i)rV   socknameNry   F)r   r   r
   r   _extragetsocknamerl   getpeernamerV   errorr:  rP   r5  _protocol_connectedset_protocol_servercollectionsdeque_buffer
_conn_lost_closing_paused_attachr%   )r&   r  r/   r0   r)   r*   r   s   &&&&&&r   r   _SelectorTransport.__init__  s2   % & 6 6t <H	+&*&6&6&8DKK
# T[[(/*.*:*:*<J' 
#( (#"((*<<#LL  &*.'+  	+&*DKK
#	+
 << /*.J'/s#   D, $E ,E	E	$E32E3c                2   V P                   P                  .pV P                  f   VP                  R4       M#V P                  '       d   VP                  R4       VP                  RV P
                   24       V P                  e   V P                  P                  4       '       g   \        V P                  P                  V P
                  \        P                  4      pV'       d   VP                  R4       MVP                  R4       \        V P                  P                  V P
                  \        P                  4      pV'       d   RpMRpV P                  4       pVP                  RV R	V R
24       RP                  RP                  V4      4      # )Nclosedclosingzfd=zread=pollingz	read=idlepollingidlezwrite=<z
, bufsize=>z<{}> )r   r    r:  appendrg  r5  _looprH   r   r!   r   r   r   get_write_buffer_sizeformatjoin)r&   inforn  stater   s   &    r   __repr___SelectorTransport.__repr__!  s)   ''(::KK!]]]KK	"c$--)*::!$***>*>*@*@*4::+?+?+/==):N:NPGN+K(*4::+?+?+/==+4+@+@BG !002GKK'%
7)1=>}}SXXd^,,r(   c                (    V P                  R 4       R # r,   )_force_closerS   s   &r   abort_SelectorTransport.abort=  s    $r(   c                     Wn         R V n        R# )TN)	_protocolr`  )r&   r0   s   &&r   ra  _SelectorTransport.set_protocol@  s    !#' r(   c                    V P                   # r,   )r  rS   s   &r   get_protocol_SelectorTransport.get_protocolD  s    ~~r(   c                    V P                   # r,   )rg  rS   s   &r   r   _SelectorTransport.is_closingG  s    }}r(   c                ^    V P                  4       '       * ;'       d    V P                  '       * # r,   )r   rh  rS   s   &r   r6  _SelectorTransport.is_readingJ  s!    ??$$99T\\)99r(   c                    V P                  4       '       g   R # RV n        V P                  P                  V P                  4       V P                  P                  4       '       d   \        P                  ! RV 4       R # R # )NTz%r pauses reading)r6  rh  rs  rN   r5  	get_debugr   r   rS   s   &r   r7   _SelectorTransport.pause_readingM  sV      

!!$--0::!!LL,d3 "r(   c                   V P                   '       g   V P                  '       g   R # RV n        V P                  V P                  V P                  4       V P
                  P                  4       '       d   \        P                  ! RV 4       R # R # )NFz%r resumes reading)	rg  rh  rY   r5  _read_readyrs  r  r   r   rS   s   &r   r<  !_SelectorTransport.resume_readingU  s^    ===(8(89::!!LL-t4 "r(   c                v   V P                   '       d   R # RV n         V P                  P                  V P                  4       V P                  '       gg   V ;P
                  ^,          un        V P                  P                  V P                  4       V P                  P                  V P                  R 4       R # R # NT)	rg  rs  rN   r5  re  rf  r   	call_soon_call_connection_lostrS   s   &r   rJ   _SelectorTransport.close]  sw    ===

!!$--0|||OOq OJJ%%dmm4JJ  !;!;TB r(   c                    V P                   e[   V! RV : 2\        V R7       V P                   P                  4        V P                  e   V P                  P	                  V 4       R # R # R # )Nzunclosed transport )source)r:  ResourceWarningrJ   rb  _detach)r&   _warns   &&r   __del___SelectorTransport.__del__g  sV    ::!'x0/$OJJ||'$$T* ( "r(   c           
     "   \        V\        4      '       d;   V P                  P                  4       '       d   \        P
                  ! R WRR7       M-V P                  P                  RVRVRV RV P                  /4       V P                  V4       R# )z%r: %sTri   rz   r{   r   r0   N)	r   rl   rs  r  r   r   r   r  r|  )r&   r   rz   s   &&&r   _fatal_error_SelectorTransport._fatal_errorn  sr    c7##zz##%%XttDJJ--7STDNN	/  	#r(   c                   V P                   '       d   R # V P                  '       d@   V P                  P                  4        V P                  P	                  V P
                  4       V P                  '       g-   RV n        V P                  P                  V P
                  4       V ;P                   ^,          un         V P                  P                  V P                  V4       R # r  )
rf  re  clearrs  r   r5  rg  rN   r  r  )r&   r   s   &&r   r|  _SelectorTransport._force_close|  s    ???<<<LL JJ%%dmm4}}} DMJJ%%dmm41

T77=r(   c                    V P                   '       d   V P                  P                  V4       V P                  P	                  4        R V n        R V n        R V n        V P                  pVe   VP                  V 4       R V n        R # R #   T P                  P	                  4        R T n        R T n        R T n        T P                  pTe   TP                  T 4       R T n        i i ; ir,   )r`  r  connection_lostr:  rJ   rs  rb  r  )r&   r   r*   s   && r   r  (_SelectorTransport._call_connection_lost  s    	$'''..s3JJDJ!DNDJ\\F!t$# " JJDJ!DNDJ\\F!t$# "s   B
 B
 
AC$c                H    \        \        \        V P                  4      4      # r,   )summapr   re  rS   s   &r   rt  (_SelectorTransport.get_write_buffer_size  s    3sDLL)**r(   c                r    V P                  4       '       g   R # V P                  P                  ! W.VO5!   R # r,   )r6  rs  rY   r   s   &&&*r   rY   _SelectorTransport._add_reader  s)      

r3d3r(   )
re  rg  rf  rs  rh  r  r`  rb  r:  r5  i   )NN)zFatal error on transport)r    rN  rO  rP  max_sizer:  r   ry  r}  ra  r  r   r6  r7  r<  rJ   warningswarnr  r  r|  r  rt  rY   rS  rT  rU  rV  s   @@r   rY  rY    sr      H
 E/8-8 (:45C %MM +
>$+4 4r(   rY  c                      a a ] tR tRt oRt]P                  P                  tRV 3R llt	V 3R lt
R tR tR tR tR	 tR
 tR tV3R lR ltR tR tR tR tV 3R ltR tR tV 3R ltRtVtV ;t# )r.   i  Tc                *  < R V n         \        SV `	  WW5V4       RV n        R V n        \
        '       d   V P                  V n        MV P                  V n        \        P                  ! V P                  4       V P                  P                  V P                  P                  V 4       V P                  P                  V P                   V P"                  V P$                  4       Ve.   V P                  P                  \&        P(                  VR 4       R # R # )NF)_read_ready_cbr   r   _eof_empty_waiter_HAS_SENDMSG_write_sendmsg_write_ready_write_sendr   _set_nodelayr:  rs  r  r  connection_maderY   r5  r  r   _set_result_unless_cancelled)r&   r  r/   r0   r1   r)   r*   r   s   &&&&&&&r   r   !_SelectorSocketTransport.__init__  s     #Xf=	!< $ 3 3D $ 0 0D 	  ,

T^^;;TB

T--!]]D,<,<	>JJ  !E!E!'/ r(   c                   < \        V\        P                  4      '       d   V P                  V n        MV P
                  V n        \        SV `  V4       R # r,   )r   r   BufferedProtocol_read_ready__get_bufferr  _read_ready__data_receivedr   ra  )r&   r0   r   s   &&r   ra  %_SelectorSocketTransport.set_protocol  s?    h	 : :;;"&">">D"&"A"ADX&r(   c                &    V P                  4        R # r,   )r  rS   s   &r   r  $_SelectorSocketTransport._read_ready  s    r(   c                   V P                   '       d   R #  V P                  P                  R4      p\        V4      '       g   \	        R4      h  T P                  P                  T4      pT'       g   T P                  4        R #  T P                  P                  T4       R #   \
        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i  \        \        3 d     R # \
        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i  \
        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i)Nz%get_buffer() returned an empty bufferz/Fatal error: protocol.get_buffer() call failed.$Fatal read error on socket transportz3Fatal error: protocol.buffer_updated() call failed.)rf  r  
get_bufferr   rG   r   r   r   r  r:  r   re   rd   _read_ready__on_eofbuffer_updated)r&   r   r   r   s   &   r   r  0_SelectorSocketTransport._read_ready__get_buffer  sG   ???		..++B/Cs88"#JKK 	ZZ))#.F $$&	LNN))&1- -. 	 	FH	  !12 	-. 	 	c#IJ	 -. 	 	LJL L	Lse   7B" C D- "C=C>CCD*2D*
D*D*D%%D*-E&E&	E!!E&c                   V P                   '       d   R #  V P                  P                  V P                  4      pT'       g   T P                  4        R #  T P                  P                  T4       R #   \        \
        3 d     R # \        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i  \        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i)Nr  z2Fatal error: protocol.data_received() call failed.)rf  r:  rc   r  re   rd   r   r   r   r  r  r  data_received)r&   r_   r   s   &  r   r  3_SelectorSocketTransport._read_ready__data_received  s    ???	::??4==1D $$&	KNN((.  !12 	-. 	 	c#IJ	 -. 	 	KIK K	KsG   %A3 C 3B?B?
B?!B?"B::B?C;C;C66C;c                   V P                   P                  4       '       d   \        P                  ! R V 4        V P                  P                  4       pT'       d(   T P                   P                  T P                  4       R# T P                  4        R#   \        \        3 d    h \         d   pT P                  TR4        Rp?R# Rp?ii ; i)z%r received EOFz1Fatal error: protocol.eof_received() call failed.N)rs  r  r   r   r  eof_receivedr   r   r   r  rN   r5  rJ   )r&   	keep_openr   s   &  r   r  ,_SelectorSocketTransport._read_ready__on_eof  s    ::!!LL*D1	335I  JJ%%dmm4JJL -. 	 	HJ	s   B C/C0CCc                   \        V\        \        \        34      '       g#   \	        R \        V4      P                  : 24      hV P                  '       d   \        R4      hV P                  e   \        R4      hV'       g   R# V P                  '       dQ   V P                  \        P                  8  d   \        P                  ! R4       V ;P                  ^,          un
        R# V P                  '       gf    V P                   P#                  V4      p\        V4      VR pV'       g   R#  T P0                  P3                  T P4                  T P6                  4       V P                  P9                  V4       V P;                  4        R#   \$        \&        3 d     Lp\(        \*        3 d    h \,         d   pT P/                  TR4        Rp?R# Rp?ii ; i)zDdata argument must be a bytes, bytearray, or memoryview object, not z%Cannot call write() after write_eof()Nz(unable to write; sendfile is in progresssocket.send() raised exception.%Fatal write error on socket transport)r   bytes	bytearrayr  r   r  r    r  rG   r  rf  r   !LOG_THRESHOLD_FOR_CONNLOST_WRITESr   warningre  r:  rk   re   rd   r   r   r   r  rs  r   r5  r  rr  _maybe_pause_protocol)r&   r_   r   r   s   &&  r   write_SelectorSocketTransport.write  sr   $	: >?? ++/:+>+>*AC D D999FGG)IJJ???)"M"MM@AOOq O|||JJOOD) "$'+  JJ""4==$2C2CD 	D!""$! $%56  12   !!#'NOs*   9F
 
GG,
G7G8GGc                L    \         P                  ! V P                  \        4      # r,   )	itertoolsislicere  r   rS   s   &r   _get_sendmsg_buffer,_SelectorSocketTransport._get_sendmsg_bufferB  s    j99r(   c                   V P                   '       d   R #  V P                  P                  V P                  4       4      pV P	                  V4       V P                  4        V P                  '       g   V P                  P                  V P                  4       V P                  e   V P                  P                  R 4       V P                  '       d   V P                  R 4       R # V P                  '       d,   V P                  P                  \         P"                  4       R # R # R #   \$        \&        3 d     R # \(        \*        3 d    h \,         d   pT P                  P                  T P                  4       T P                  P/                  4        T P1                  TR4       T P                  e"   T P                  P3                  T4        R p?R #  R p?R # R p?ii ; iNr  )rf  r:  r   r  _adjust_leftover_buffer_maybe_resume_protocolre  rs  r   r5  r  r   rg  r  r  shutdownrV   SHUT_WRre   rd   r   r   r   r  r  r   )r&   r   r   s   &  r   r  '_SelectorSocketTransport._write_sendmsgE  s^   ???	8ZZ''(@(@(BCF((0 '')<<<

))$--8%%1&&11$7===..t4YYYJJ''7     !12 	-. 	 	6JJ%%dmm4LL c#JK!!-""0055 .		6s*   :D& &G :G 	
G G A:GG c                $   < V ^8  d   QhRS[ RR/# )   r   returnN)r   )ru  rW  s   "r   __annotate__%_SelectorSocketTransport.__annotate__a  s     	 	c 	d 	r(   c                    V P                   pV'       dA   VP                  4       p\        V4      pWA8:  d   W,          pK3  VP                  W1R  4       R # R # r,   )re  popleftr   
appendleft)r&   r   bufferbb_lens   &&   r   r  0_SelectorSocketTransport._adjust_leftover_buffera  sI     AFE!!!G*- r(   c                   V P                   '       d   R #  V P                  P                  4       pV P                  P	                  V4      pV\        V4      8w  d   V P                  P                  WR  4       V P                  4        V P                  '       g   V P                  P                  V P                  4       V P                  e   V P                  P                  R 4       V P                  '       d   V P                  R 4       R # V P                  '       d,   V P                  P!                  \"        P$                  4       R # R # R #   \&        \(        3 d     R # \*        \,        3 d    h \.         d   pT P                  P                  T P                  4       T P                  P1                  4        T P3                  TR4       T P                  e"   T P                  P5                  T4        R p?R #  R p?R # R p?ii ; ir  )rf  re  r  r:  rk   r   r  r  rs  r   r5  r  r   rg  r  r  r  rV   r  re   rd   r   r   r   r  r  r   )r&   r  r   r   s   &   r   r  $_SelectorSocketTransport._write_sendl  sy   ???	8\\))+F

'ACK''r
3 '')<<<

))$--8%%1&&11$7===..t4YYYJJ''7     !12 	-. 	 	6JJ%%dmm4LL c#JK!!-""0055 .		6s+   A"E H"H1
H<H=A:HHc                    V P                   '       g   V P                  '       d   R # RV n        V P                  '       g,   V P                  P	                  \
        P                  4       R # R # r  )rg  r  re  r:  r  rV   r  rS   s   &r   	write_eof"_SelectorSocketTransport.write_eof  sA    ===DIII	|||JJ/ r(   c                   V P                   '       d   \        R 4      hV P                  e   \        R4      hV'       g   R# V P                  P	                  V Uu. uF  p\        V4      NK  	  up4       V P                  4        V P                  '       dC   V P                  P                  V P                  V P                  4       V P                  4        R# R# u upi )z*Cannot call writelines() after write_eof()Nz-unable to writelines; sendfile is in progress)r  rG   r  re  extendr  r  rs  r   r5  r  )r&   list_of_datar_   s   && r   
writelines#_SelectorSocketTransport.writelines  s    999KLL)NOO,G,$Z-,GH<<<JJ""4==$2C2CD&&(  Hs   Cc                    R # )Tr]   rS   s   &r   can_write_eof&_SelectorSocketTransport.can_write_eof  s    r(   c                  <  \         SV `  V4       R V n        V P                  e'   V P                  P	                  \        R4      4       R # R #   R T n        T P                  e&   T P                  P	                  \        R4      4       i i ; i)NzConnection is closed by peer)r   r  r  r  r   ConnectionError)r&   r   r   s   &&r   r  ._SelectorSocketTransport._call_connection_lost  s    	EG)#. $D!!-""00#$BCE . !%D!!-""00#$BCE .s   A <Bc                    V P                   e   \        R4      hV P                  P                  4       V n         V P                  '       g   V P                   P                  R 4       V P                   # )NzEmpty waiter is already set)r  rG   rs  r   re  r   rS   s   &r   r8  +_SelectorSocketTransport._make_empty_waiter  sX    )<==!ZZ557|||))$/!!!r(   c                    R V n         R # r,   )r  rS   s   &r   r;  ,_SelectorSocketTransport._reset_empty_waiter  s
    !r(   c                2   < R V n         \        SV `	  4        R # r,   )r  r   rJ   rK   s   &r   rJ   _SelectorSocketTransport.close  s    "r(   )r  r  r  r  rM  )r    rN  rO  rP  _start_tls_compatibler   _SendfileMode
TRY_NATIVE_sendfile_compatibler   ra  r  r  r  r  r  r  r  r  r  r  r  r  r  r8  r;  rJ   rS  rT  rU  rV  s   @@r   r.   r.     s      $22==/2'#LJK2*%%N:88	 	8>0)E"" r(   r.   c                   j   a a ] tR tRt o]P
                  tRV 3R lltR tR t	R	R lt
R tRtVtV ;t# )
rA   i  c                z  < \         SV `  WW64       W@n        ^ V n        V P                  P                  V P                  P                  V 4       V P                  P                  V P                  V P                  V P                  4       Ve.   V P                  P                  \        P                  VR4       R# R# )r   N)r   r   _address_buffer_sizers  r  r  r  rY   r5  r  r   r  )r&   r  r/   r0   rB   r1   r)   r   s   &&&&&&&r   r   #_SelectorDatagramTransport.__init__  s    X5

T^^;;TB

T--!]]D,<,<	>JJ  !E!E!'/ r(   c                    V P                   # r,   )r  rS   s   &r   rt  0_SelectorDatagramTransport.get_write_buffer_size  s       r(   c                   V P                   '       d   R #  V P                  P                  V P                  4      w  rV P                  P                  W4       R #   \        \        3 d     R # \         d'   pT P                  P                  T4        R p?R # R p?i\        \        3 d    h \         d   pT P                  TR4        R p?R # R p?ii ; i)Nz&Fatal read error on datagram transport)rf  r:  r   r  r  datagram_receivedre   rd   rl   error_receivedr   r   r   r  r&   r_   r   r   s   &   r   r  &_SelectorDatagramTransport._read_ready  s    ???	9,,T]];JD NN,,T8  !12 	 	/NN))#..-. 	 	Mc#KLL	Ms;   'A C.C7C8BC,
C7C8CCc                   \        V\        \        \        34      '       g#   \	        R \        V4      P                  : 24      hV P                  '       d8   VRV P                  39  d   \        RV P                   24      hV P                  pV P                  '       dc   V P                  '       dQ   V P                  \        P                  8  d   \        P                  ! R4       V ;P                  ^,          un	        R# V P                  '       gU    V P                  R,          '       d   V P                   P#                  V4       R# V P                   P%                  W4       R# V P                  PA                  \        V4      V34       V ;PB                  \E        V4      ^,           ,          un!        V PG                  4        R#   \&        \(        3 d4    T P*                  P-                  T P.                  T P0                  4        L\2         d'   pT P4                  P7                  T4        Rp?R# Rp?i\8        \:        3 d    h \<         d   pT P?                  TR4        Rp?R# Rp?ii ; i)z/data argument must be a bytes-like object, not Nz!Invalid address: must be None or r  ry   'Fatal write error on datagram transport)$r   r  r  r  r   r  r    r  r   rf  r   r  r   r  re  r\  r:  rk   r  re   rd   rs  r   r5  _sendto_readyrl   r  r  r   r   r   r  rr  r  r   r  r  s   &&& r   r  !_SelectorDatagramTransport.sendto  s   $	: >?? ##':#6#6"9; < < ===D$--00 7GI I==D???t}}})"M"MM@AOOq O|||;;z**JJOOD)  JJ%%d1 	U4[$/0SY]*""$ $%56 J

&&t}}d6H6HI --c2 12   !!BDsI   G -G 
G AI2I2I2H66I2	
I2I2I--I2c                   V P                   '       d   V P                   P                  4       w  rV ;P                  \        V4      ,          un         V P                  R ,          '       d   V P
                  P                  V4       K  V P
                  P                  W4       K  V P%                  4        V P                   '       gM   V P&                  P)                  V P*                  4       V P,                  '       d   V P/                  R4       R# R# R#   \        \        3 dC    T P                   P                  Y34       T ;P                  \        T4      ,          un         K  \         d'   pT P                  P                  T4        Rp?R# Rp?i\        \        3 d    h \          d   pT P#                  TR4        Rp?R# Rp?ii ; i)ry   Nr  )re  r  r  r   r\  r:  rk   r  re   rd   r  rl   r  r  r   r   r   r  r  rs  r   r5  rg  r  r  s   &   r   r  (_SelectorDatagramTransport._sendto_ready  sK   lll--/JDT*;;z**JJOOD)JJ%%d1 	##%|||JJ%%dmm4}}}**40   $%56 ''5!!SY.! --c2 12   !!BDsC   4D D AG'G0G1FG%
G0G1G		G)r  r  rM  r,   )r    rN  rO  rP  rc  rd  _buffer_factoryr   rt  r  r  r  rS  rT  rU  rV  s   @@r   rA   rA     s/     !''O/!9 (%T1 1r(   rA   )r   )%__all__rc  r   r   r  osr   rV   r  r#   sslImportError r   r   r   r   r   r   r	   r
   logr   hasattrr  sysconfr   rl   r   BaseEventLoopr   _FlowControlMixin	TransportrY  r.   DatagramTransportrA   r]   r(   r   <module>r*     s    #     	             v}}i0ZZ-

(CK55 CLa455#--a4HZ1 Zzj1!3Z5Q5Q j1Q%  
C$  s#   C+ >C: +	C76C7:	DD