+
    G8
k+:  ã                   óÒ   € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RI
HtHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt R	tR
 R lt ! R R4      t ! R R4      tR# )z&A non-blocking TCP connection factory.N)ÚCallableÚIterator)ÚAnyÚTuple)Úgen)ÚFutureÚfuture_add_done_callback)ÚIOLoop)ÚIOStream©ÚResolverg333333Ó?c                ó0   € V ^8„  d   QhR\         R\        /# )é   ÚaddrÚreturn)r   Ústr)Úformats   "Úˆ/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/tornado/tcpclient.pyÚ__annotate__r   $   s   € ÷ ñ ”sð œsñ ó    c                óÒ   € \        V \        4      '       dH   \        V 4      ^8¼  d8   V R,          w  r\        V\        4      '       d   RV9   d	   RV RV 2# V RV 2# \        V 4      # )z°Format a socket address for use in error messages.

IPv4 addresses are formatted as ``1.2.3.4:443`` and IPv6 addresses as
``[::1]:443``. Anything else is formatted with `str`.
:Nr   NÚ:Ú[z]:)Ú
isinstanceÚtupleÚlenr   )r   ÚhostÚports   &  r   Ú_format_addrr   $   sg   € ô �$œ×Ò¤3 t£9°¤>Ø˜"•X‰
ˆÜ�dœC× Ò  S¨D¤[Ø�t�f˜B˜t˜fÐ%Ð%Ø��q˜˜ÐÐÜˆt‹9Ðr   c                   ó   a € ] tR t^2t o RtV 3R lR lt]V 3R lR l4       t]R3V 3R lR llt	V 3R	 lR
 lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )Ú
_Connectorat  A stateless implementation of the "Happy Eyeballs" algorithm.

"Happy Eyeballs" is documented in RFC6555 as the recommended practice
for when both IPv4 and IPv6 addresses are available.

In this implementation, we partition the addresses by family, and
make the first connection attempt to whichever address was
returned first by ``getaddrinfo``.  If that connection fails or
times out, we begin a connection in parallel to the first address
of the other family.  If there are additional failures we retry
with other addresses, keeping one connection attempt per family
in flight at a time.

http://tools.ietf.org/html/rfc6555

c                ó~   <€ V ^8„  d   QhRS[ S[,          RS[S[P                  S[.S[S[R3,          3,          RR/# )r   ÚaddrinfoÚconnectúFuture[IOStream]r   N)Úlistr   r   ÚsocketÚAddressFamilyr
   )r   Ú__classdict__s   "€r   r   Ú_Connector.__annotate__D   sP   ø€ ÷ /ñ /á‘u•+ð/ñ Ù×!Ñ!¡5Ð)©5±Ð;MÐ1MÕ+NÐNõ
ð/ð 
ñ/r   c                ó&  € \         P                  ! 4       V n        W n        \	        4       V n        R V n        R V n        R V n        \        V4      V n
        V P                  V4      w  V n        V n        \        4       V n        \        4       V n        R # ©N)r	   ÚcurrentÚio_loopr#   r   ÚfutureÚtimeoutÚconnect_timeoutÚ
last_errorr   Ú	remainingÚsplitÚprimary_addrsÚsecondary_addrsÚsetÚstreamsÚpending_addrs)Úselfr"   r#   s   &&&r   Ú__init__Ú_Connector.__init__D   so   € ô —~’~Ó'ˆŒØŒäJPË(ˆŒØ&*ˆŒØ.2ˆÔØ,0ˆŒÜ˜X›ˆŒØ37·:±:¸hÓ3GÑ0ˆÔ˜DÔ0Ü&)£eˆŒô *-«ˆÖr   c          	      óÀ   <€ V ^8„  d   QhRS[ S[,          RS[S[ S[S[P                  S[3,          ,          S[ S[S[P                  S[3,          ,          3,          /# )r   r"   r   )r%   r   r&   r'   )r   r(   s   "€r   r   r)   Z   s[   ø€ ÷ "ñ "Ù‘u•+ð"á	Ù‰U‘6×'Ñ'©Ð.Õ/Õ0Ù‰U‘6×'Ñ'©Ð.Õ/Õ0ð	2õ
ñ"r   c                óž   € . p. pV ^ ,          ^ ,          pV  F1  w  rEWC8X  d   VP                  WE34       K  VP                  WE34       K3  	  W3# )aT  Partition the ``addrinfo`` list by address family.

Returns two lists.  The first list contains the first entry from
``addrinfo`` and all others with the same family, and the
second list contains all other addresses (normally one list will
be AF_INET and the other AF_INET6, although non-standard resolvers
may return additional families).
)Úappend)r"   ÚprimaryÚ	secondaryÚ
primary_afÚafr   s   &     r   r3   Ú_Connector.splitY   sV   € ð ˆØˆ	Ø˜a•[ •^ˆ
Û ‰HˆBØÔØ—‘ ˜zÖ*à× Ñ  " Ö,ñ	 !ð
 Ð!Ð!r   Nc                ó\   <€ V ^8„  d   QhRS[ RS[ S[P                  ,          R,          RR/# )r   r/   r0   Nr   ú2Future[Tuple[socket.AddressFamily, Any, IOStream]]©ÚfloatÚdatetimeÚ	timedelta)r   r(   s   "€r   r   r)   r   s9   ø€ ÷ ñ áðñ ¡×!3Ñ!3Õ3°dÕ:ðð 
>ñ	r   c                óî   € V P                  V4       Ve   V P                  V4       V P                  \        V P                  4      4       \        V P                  V P                  4       V P                  # r+   )Úset_timeoutÚset_connect_timeoutÚtry_connectÚiterr4   r   r.   Úon_future_done)r9   r/   r0   s   &&&r   ÚstartÚ_Connector.startr   s]   € ð 	×Ñ˜Ô!ØÒ&Ø×$Ñ$ _Ô5Ø×Ñœ˜d×0Ñ0Ó1Ô2Ü  §¡¨d×.AÑ.AÔBØ�{‰{Ðr   c                ó^   <€ V ^8„  d   QhRS[ S[S[P                  S[3,          ,          RR/# )r   Úaddrsr   N©r   r   r&   r'   )r   r(   s   "€r   r   r)   €   s1   ø€ ÷ 
ñ 
¡©%±×0DÑ0DÁeÐ0KÕ*LÕ!Mð 
ÐRVñ 
r   c           	     óŠ  €  \        V4      w  r# T P                  Y#4      w  rET P                  P                  T4       T P                  P                  T4       \        T\         P"                  ! T P$                  YT4      4       R#   \         d~    T P                  ^ 8X  di   T P                  P	                  4       '       gI   T P                  P                  T P                  ;'       g    \        R4      4       T P                  4         R# i ; i  \         d&   p\        4       pTP                  T4        Rp?LäRp?ii ; i)é    zconnection failedN)ÚnextÚStopIterationr2   r.   ÚdoneÚset_exceptionr1   ÚIOErrorÚclose_streamsr#   r7   Úaddr8   Ú	Exceptionr   r   Ú	functoolsÚpartialÚon_connect_done)r9   rS   rB   r   Ústreamr.   Úes   &&     r   rM   Ú_Connector.try_connect€   s  € ð	Ü˜E“{‰HˆBð
	)Ø!Ÿ\™\¨"Ó3‰NˆFð �L‰L×Ñ˜VÔ$Ø×Ñ×"Ñ" 4Ô(Ü Ø”I×%Ò% d×&:Ñ&:¸EÀtÓLö	
øô/ ô 	ð �~‰~ Ô"¨4¯;©;×+;Ñ+;×+=Ò+=Ø—‘×)Ñ)Ø—O‘O×CÐC¤wÐ/BÓ'Côð
 ×"Ñ"Ô$Úð	ûô ô 	$ô “XˆFØ× Ñ  ×#Ñ#ûð	$ús4   ‚B �D Â;DÃ'DÃ+ DÄDÄEÄD=Ä=Ec          
      ó‚   <€ V ^8„  d   QhRS[ S[S[P                  S[3,          ,          RS[P                  RS[RRRR/# )r   rS   rB   r   r.   r$   r   NrT   )r   r(   s   "€r   r   r)   ž   sX   ø€ ÷ "!ñ "!á™™f×2Ñ2±EÐ9Õ:Õ;ð"!ñ × Ñ ð"!ñ ð	"!ð
 #ð"!ð 
ñ"!r   c                ó6  € V ;P                   ^,          un         V P                  P                  V4        VP                  4       pT P!                  4        T P                  P                  4       '       d   TP#                  4        R# T P$                  P                  T4       T P                  P'                  Y#T34       T P)                  4        R#   \        \
        P                  3 d¬   pT P                  P                  4       '       d    Rp?R# \        T\
        P                  4      '       g   Y`n
        T P                  T4       T P                  e6   T P                  P                  T P                  4       T P                  4         Rp?R# Rp?ii ; i)é   N)r2   r8   ÚdiscardÚresultr^   ÚasyncioÚCancelledErrorr.   rY   r   r1   rM   r/   r-   Úremove_timeoutÚ
on_timeoutÚclear_timeoutsÚcloser7   Ú
set_resultr\   )r9   rS   rB   r   r.   rb   rc   s   &&&&&  r   ra   Ú_Connector.on_connect_donež   s  € ð 	�Š˜!Õ�Ø×Ñ×"Ñ" 4Ô(ð	Ø—]‘]“_ˆFð" 	×ÑÔØ�;‰;×Ñ×Òà�L‰LŽNà�L‰L× Ñ  Ô(Ø�K‰K×"Ñ" B¨fÐ#5Ô6Ø×ÑÖ øô/ œ7×1Ñ1Ð2ô 	Ø�{‰{×Ñ×!Ò!Ýô
 ˜a¤×!7Ñ!7×8Ò8Ø"#”Ø×Ñ˜UÔ#Ø�|‰|Ò'ð —‘×+Ñ+¨D¯L©LÔ9Ø—‘Ô!Ýûð	ús   ¶C ÃFÃ- FÄA:FÆFc                ó"   <€ V ^8„  d   QhRRRR/# )r   r.   rE   r   N© )r   r(   s   "€r   r   r)   Â   s   ø€ ÷ !ñ !ØJð!à	ñ!r   c                óv   € VP                  4       '       d#   V P                  4        V P                  4        R # R # r+   )Ú	cancelledrn   r\   )r9   r.   s   &&r   rO   Ú_Connector.on_future_doneÂ   s2   € ð ×Ñ×Òð ×ÑÔ!Ø×ÑÖ ñ r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r/   r   N)rG   )r   r(   s   "€r   r   r)   Ì   s   ø€ ÷ 
ñ 
¡5ð 
¨Tñ 
r   c                óš   € V P                   P                  V P                   P                  4       V,           V P                  4      V n        R # r+   )r-   Úadd_timeoutÚtimerm   r/   )r9   r/   s   &&r   rK   Ú_Connector.set_timeoutÌ   s3   € Ø—|‘|×/Ñ/Ø�L‰L×ÑÓ 'Õ)¨4¯?©?ó
ˆŽr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nrs   )r   r(   s   "€r   r   r)   Ñ   s   ø€ ÷ 9ñ 9˜Dñ 9r   c                ó    € R V n         V P                  P                  4       '       g'   V P                  \	        V P
                  4      4       R # R # r+   )r/   r.   rY   rM   rN   r5   ©r9   s   &r   rm   Ú_Connector.on_timeoutÑ   s:   € ØˆŒØ�{‰{×Ñ×!Ò!Ø×ÑœT $×"6Ñ"6Ó7Ö8ñ "r   c                ó   <€ V ^8„  d   QhRR/# r}   rs   )r   r(   s   "€r   r   r)   Ö   s   ø€ ÷ 6ñ 6˜tñ 6r   c                óp   € V P                   e(   V P                  P                  V P                   4       R # R # r+   )r/   r-   rl   r   s   &r   Úclear_timeoutÚ_Connector.clear_timeoutÖ   s'   € Ø�<‰<Ò#Ø�L‰L×'Ñ'¨¯©Ö5ñ $r   c                óH   <€ V ^8„  d   QhRS[ S[P                  ,          RR/# )r   r0   r   NrF   )r   r(   s   "€r   r   r)   Ú   s'   ø€ ÷ 
ñ 
±5¹8×;MÑ;MÕ3Mð 
ÐRVñ 
r   c                óZ   € V P                   P                  WP                  4      V n        R # r+   )r-   ry   Úon_connect_timeoutr0   )r9   r0   s   &&r   rL   Ú_Connector.set_connect_timeoutÚ   s"   € Ø#Ÿ|™|×7Ñ7Ø×4Ñ4ó 
ˆÖr   c                ó   <€ V ^8„  d   QhRR/# r}   rs   )r   r(   s   "€r   r   r)   ß   s   ø€ ÷ 	ñ 	 Dñ 	r   c                ó<  € V P                   P                  4       '       gl   V P                  '       d4   R RP                  \	        R V P                   4       4      4      ,          pMRpV P                   P                  \        V4      4       V P                  4        R# )zTimeout while connecting to %sz, c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir+   ©r   )Ú.0r   s   & r   Ú	<genexpr>Ú0_Connector.on_connect_timeout.<locals>.<genexpr>ã   s   é € ÐMÑ:L°$œ<¨×-Ð-Ó:Lùs   ‚zTimeout while connectingN)r.   rY   r8   ÚjoinÚsortedrZ   ÚTimeoutErrorr\   )r9   Úmessages   & r   r‡   Ú_Connector.on_connect_timeoutß   st   € Ø�{‰{×Ñ×!Ò!Ø×!×!Ð!Ø:¸T¿Y¹YÜÑM¸$×:LÒ:LÓMÓMó>õ ‘ð 5�Ø�K‰K×%Ñ%¤l°7Ó&;Ô<Ø×ÑÖr   c                ó   <€ V ^8„  d   QhRR/# r}   rs   )r   r(   s   "€r   r   r)   ê   s   ø€ ÷ >ñ > ñ >r   c                óÖ   € V P                   e&   V P                  P                  V P                   4       V P                  e(   V P                  P                  V P                  4       R # R # r+   )r/   r-   rl   r0   r   s   &r   rn   Ú_Connector.clear_timeoutsê   sK   € Ø�<‰<Ò#Ø�L‰L×'Ñ'¨¯©Ô5Ø×ÑÒ+Ø�L‰L×'Ñ'¨×(<Ñ(<Ö=ñ ,r   c                ó   <€ V ^8„  d   QhRR/# r}   rs   )r   r(   s   "€r   r   r)   ð   s   ø€ ÷ ñ ˜tñ r   c                óL   € V P                    F  pVP                  4        K  	  R # r+   )r7   ro   )r9   rb   s   & r   r\   Ú_Connector.close_streamsð   s   € Ø—l”lˆFØ�L‰LŽNó #r   )r#   r0   r.   r-   r1   r8   r4   r2   r5   r7   r/   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r:   Ústaticmethodr3   Ú_INITIAL_CONNECT_TIMEOUTrP   rM   ra   rO   rK   rm   rƒ   rL   r‡   rn   r\   Ú__static_attributes__Ú__classdictcell__©r(   s   @r   r    r    2   sŸ   ø‡ € ñ÷"/ð /ð* ÷"ó ð"ð4 2Ø=A÷ò ÷
ð 
÷<"!ð "!÷H!ð !÷
ð 
÷
9ð 9÷
6ð 6÷
ð 
÷
	ð 	÷>ð >÷ö r   r    c                   ó˜   a € ] tR t^õt o RtRV 3R lR lltV 3R lR lt]P                  RRRRR3V 3R lR llt	RV 3R	 lR
 llt
RtV tR# )Ú	TCPClientz�A non-blocking TCP connection factory.

.. versionchanged:: 5.0
   The ``io_loop`` argument (deprecated since version 4.1) has been removed.
Nc                ó2   <€ V ^8„  d   QhRS[ R,          RR/# )r   ÚresolverNr   r   )r   r(   s   "€r   r   ÚTCPClient.__annotate__ü   s   ø€ ÷ &ñ &¡¨D¥ð &¸Dñ &r   c                óX   € Ve   Wn         RV n        R # \        4       V n         RV n        R # )NFT)r¨   Ú_own_resolverr   )r9   r¨   s   &&r   r:   ÚTCPClient.__init__ü   s&   € ØÒØ$ŒMØ!&ˆDÖä$›JˆDŒMØ!%ˆDÖr   c                ó   <€ V ^8„  d   QhRR/# r}   rs   )r   r(   s   "€r   r   r©     s   ø€ ÷ "ñ "�tñ "r   c                ób   € V P                   '       d   V P                  P                  4        R # R # r+   )r«   r¨   ro   r   s   &r   ro   ÚTCPClient.close  s#   € Ø××ÐØ�M‰M×ÑÖ!ñ r   c                ó  <€ V ^8„  d   QhRS[ RS[RS[P                  RS[S[ S[3,          S[P                  ,          R,          RS[R,          RS[ R,          RS[R,          R	S[S[	P                  ,          R,          R
S[/	# )r   r   r   rB   Ússl_optionsNÚmax_buffer_sizeÚ	source_ipÚsource_portr/   r   )r   Úintr&   r'   Údictr   ÚsslÚ
SSLContextrG   rH   rI   r
   )r   r(   s   "€r   r   r©     s¨   ø€ ÷ ]ñ ]áð]ñ ð]ñ × Ñ ð	]ñ
 ™#™s˜(•^¡c§n¡nÕ4°tÕ;ð]ñ ˜t�ð]ñ ˜•:ð]ñ ˜4•Zð]ñ ™×+Ñ+Õ+¨dÕ2ð]ñ 
ñ]r   c	           
   ƒ  óä  a"  € Ve·   \        V\        P                  4      '       d,   \        P                  ! 4       P                  4       V,           pMk\        V\        P                  4      '       d:   \        P                  ! 4       P                  4       VP                  4       ,           pM\        RV,          4      hVe@   \        P                  ! VV P                  P                  WV4      RV 2R7      G Rj  x€L
 p	M$V P                  P                  WV4      G Rj  x€L
 p	\        V	\        P                   ! V P"                  VVVR7      4      p
V
P%                  VR7      G Rj  x€L
 w  popVe[   VP'                  RWAR7      p Ve'   \        P                  ! VVV3R	 lR7      G Rj  x€L
 pM
VG Rj  x€L
 pVP)                  4        V# V#  LÕ L² Ll L) L   TP)                  4        i ; i5i)
a¯  Connect to the given host and port.

Asynchronously returns an `.IOStream` (or `.SSLIOStream` if
``ssl_options`` is not None).

Using the ``source_ip`` kwarg, one can specify the source
IP address to use when establishing the connection.
In case the user needs to resolve and
use a specific interface, it has to be handled outside
of Tornado as this depends very much on the platform.

Raises `TimeoutError` if the input future does not complete before
``timeout``, which may be specified in any form allowed by
`.IOLoop.add_timeout` (i.e. a `datetime.timedelta` or an absolute time
relative to `.IOLoop.time`)

The message of the `TimeoutError` indicates which phase of the
connection timed out: resolving the hostname, establishing the TCP
connection (listing the addresses being tried), or performing the
TLS handshake.

Similarly, when the user requires a certain source port, it can
be specified using the ``source_port`` arg.

.. versionchanged:: 4.5
   Added the ``source_ip`` and ``source_port`` arguments.

.. versionchanged:: 5.0
   Added the ``timeout`` argument.

.. versionchanged:: 6.6
   Timeout errors now have messages describing which phase of
   the connection process timed out.
NzUnsupported timeout %rzTimeout while resolving )r“   )r³   r´   )r0   F)r±   Úserver_hostnamec                  ó(   <€ R \        S 4      ,           # )z"Timeout during TLS handshake with rŒ   )r   s   €r   Ú<lambda>Ú#TCPClient.connect.<locals>.<lambda>Z  s   ø€ Ð(LÜ& tÓ,ö)-r   )r   ÚnumbersÚRealr	   r,   rz   rH   rI   Útotal_secondsÚ	TypeErrorr   Úwith_timeoutr¨   Úresolver    r_   r`   Ú_create_streamrP   Ú	start_tlsÚcancel)r9   r   r   rB   r±   r²   r³   r´   r/   r"   Ú	connectorrb   Ú
tls_futurer   s   &&&&&&&&&    @r   r#   ÚTCPClient.connect  sº  øé € ðZ ÒÜ˜'¤7§<¡<×0Ò0Ü Ÿ.š.Ó*×/Ñ/Ó1°GÕ;‘Ü˜G¤X×%7Ñ%7×8Ò8Ü Ÿ.š.Ó*×/Ñ/Ó1°G×4IÑ4IÓ4KÕK‘äÐ 8¸7Õ BÓCÐCØÒÜ ×-Ò-ØØ—‘×%Ñ% d°"Ó5Ø2°4°&Ð9ô÷ ‰Hð "Ÿ]™]×2Ñ2°4¸rÓB×BˆHÜØÜ×ÒØ×#Ñ#ØØ#Ø'ô	ó
ˆ	ð "+§¡À Ó!I×IÑˆˆD�&ð Ò"Ø×)Ñ)Ø ;ð *ó ˆJð$ØÒ&Ü#&×#3Ò#3ØØ"ô!-ô$÷ ‘Fð $.×-�Fð ×!Ñ!Ô#ØˆˆvˆñQñ Cñ Jññ .øð ×!Ñ!Õ#üss   ƒC8G0Ã;GÃ<$G0Ä GÄ!AG0Å(GÅ)G0Æ	$G Æ-GÆ.
G Æ8GÆ9G Æ=G0ÇG0ÇG0ÇG ÇG ÇG-Ç-G0c                ó�   <€ V ^8„  d   QhRS[ R,          RS[P                  RS[RS[R,          RS[ R,          RS[S[R3,          /# )	r   r²   NrB   r   r³   r´   r   r$   )rµ   r&   r'   r   r   r
   )r   r(   s   "€r   r   r©   g  sd   ø€ ÷ ,ñ ,á˜t�ð,ñ × Ñ ð,ñ ð	,ñ
 ˜•:ð,ñ ˜4•Zð,ñ 
‰xÐ+Ð+Õ	,ñ,r   c                óz  € \        V\        4      '       d   TM^ pTpV'       d"   V'       g   V\        P                  8X  d   RMRp\        P                  ! V4      p V'       g	   V'       d   VP	                  Wv34       \        W�R7      p	Y™P                  T4      3#   \         d    TP                  4        h i ; i)rV   z::1z	127.0.0.1)r²   )	r   rµ   r&   ÚAF_INET6Úbindr
   ÚBaseExceptionro   r#   )
r9   r²   rB   r   r³   r´   Úsource_port_bindÚsource_ip_bindÚ
socket_objrb   s
   &&&&&&    r   rÄ   ÚTCPClient._create_streamg  s�   € ô +5°[Ä#×*FÒ*F™;ÈAÐØ"ˆß§Ið ')¬F¯O©OÔ&;™UÀˆNô —]’] 2Ó&ˆ
ð	ß§>à—‘ Ð BÔCÜ˜jÔJˆFð —~‘~ dÓ+Ð+Ð+øô ô 	Ø×ÑÔØð	ús   ÁB Á%B Á-B ÂB:)r«   r¨   r+   )NN)r›   rœ   r�   rž   rŸ   r:   ro   r&   Ú	AF_UNSPECr#   rÄ   r¢   r£   r¤   s   @r   r¦   r¦   õ   sT   ø‡ € ñ÷&ò &÷"ð "ð $*×#3Ñ#3Ø>BØ&*Ø $Ø"&Ø59÷]ò ]÷~,÷ ,ð ,r   r¦   )rŸ   rj   rH   r_   r¾   r&   r·   Úcollections.abcr   r   Útypingr   r   Útornador   Útornado.concurrentr   r   Útornado.ioloopr	   Útornado.iostreamr
   Útornado.netutilr   r¡   r   r    r¦   rs   r   r   Ú<module>rÛ      sU   ðñ  -ã Û Û Û Û Û 
ß .ß å ß ?Ý !Ý %Ý $àÐ õ÷@ñ @÷FN,ó N,r   