Wcߑ* ddlZddlTddlZddlZddlZddlZddlmZmZ ddlZe eddZ e eddZ e eddZ gd Zejej eej"d ed ej"d ed ej"dedej"deddZdZdZej,j/j1driZded<ded<ded<ded<ded<d ed!<d"ed#<d$ed%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d0ed1<d2ed3<d4ed5<d6ed7<d8ed9<d:ed;<ded?<d@edA<dBedC<dDedE<dFedG<dHedI<dJedK<dLedM<dNedO<dPedQ<dRedS<dTedU<dVedW<dXedY<dZed[<d\ed]<d^ed_<d`eda<dbedc<ddede<dfedg<dhedi<djedk<dledm<dnedo<dpedq<dreds<dtedu<dvedw<dxedy<dzed{<d|ed}<d~ed<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ej5dҫGdӄdeZGdՄdej:ZddׄZeej:dثrddl Z ddلZ!ej5dګeej:d۫rddl Z dd܄Z"ej5dݫeej:dޫrd߄Z#ej5deedrde$dfdZ%ne&e$dfdZ%ej5dde%_'e e hZ(GddejRZ*ddZ+e,Z-e-dfdddZ.dZ/e&dddddZ0ddZ1dS#e $rdZYwxYw)N)*)IntEnumIntFlagEBADF EAGAIN EWOULDBLOCK)fromfdgetfqdncreate_connection create_serverhas_dualstack_ipv6 AddressFamily SocketKindrcH|jo|jdS)NAF_isupper startswithCs /usr/lib64/python3.12/socket.pyrO!))+5!,,u"5rcH|jo|jdS)NSOCK_rrs rrrTs!))+7!,,w"7rMsgFlagcH|jo|jdS)NMSG_rrs rrrYs!))+6!,,v"6r AddressInfocH|jo|jdS)NAI_rrs rrr^rrz 127.0.0.1z::1c< ||S#t$r|cYSwxYwN) ValueError)value enum_klasss r_intenum_converterr*ds=z%   s  winz)Specified event object handle is invalid.zInsufficient memory available.z#One or more parameters are invalid.WzOverlapped operation aborted.iz2Overlapped I/O event object not in signaled state.iz)Overlapped operation will complete later.izThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z!The socket operation would block.i3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i'zHost not found.i*z Nonauthoritative host not found.i*zThis is a nonrecoverable error.i*z*Valid name, no data record requested type.i*zQoS receivers.i*z QoS senders.i*zNo QoS senders.i*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i +zInvalid QoS provider buffer.i +zInvalid QoS filter style.i +i +zIncorrect QoS filter count.i +zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+errorTabceZdZdS)_GiveupOnSendfileN)__name__ __module__ __qualname__rrr1r1srr1cNeZdZ gdZd"dZdZdZdZdZd Z d Z d#dddd d Z e e drd$dZnd$dZd$dZdZd$dZdZej(fdZdZfdZefdZefdZe j6dkrdZdZndZdZd e_d!e_xZS)%socket) __weakref___io_refs_closedNc|"|dkrt}|dkrt}|dkrd}tjj |||||d|_d|_dS)Nr;rF)AF_INET SOCK_STREAM_socketr7__init__r9r:)selffamilytypeprotofilenos rr@zsocket.__init__sb >|| rzz"{{fdE6BB  rc|Sr&r5rAs r __enter__zsocket.__enter__s rcD|js|jdSdSr&)r:close)rAargss r__exit__zsocket.__exit__s!||| JJLLLL|rc t|dd}d|jj|jj|rdnd|j |j |j |jfz}|sN |j}|r|dt|zz } |j}|r|dt|zz }|dz }|S#ttf$rYAwxYw#ttf$rY1wxYw) Nr:Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz [closed]z , laddr=%sz , raddr=%s>) getattr __class__r3r4rErBrCrD getsocknamestrerrorAttributeError getpeername)rAclosedsladdrraddrs r__repr__zsocket.__repr__s$ y%0 :~~((~~**$f{{"{{}{{yyzz  v ((*5E 22A ((*5E 22A S>*     >*    s$9&C &C$ C! C!$C87C8cLtd|jjd)Nzcannot pickle z object) TypeErrorrQr2rGs r __getstate__zsocket.__getstate__s#K)@)@KKKLLrc t|j}|j|j|j|j |}|j |j|S)NrE)duprErQrBrCrD settimeout gettimeout)rAfdsocks rraz socket.dupsV  ~~dkk499djj~L )** rc |j\}}t|j|j|j|}t #|j r|jd||fS)Nr`T)_acceptr7rBrCrDgetdefaulttimeoutrc setblocking)rArdaddrres racceptz socket.accept si <<>Ddkk499djjDD   &4??+<+<   T " "Tzrr)encodingerrorsnewlinecR t|hdkstd|dd|v}d|vp| }d|v}d} |r| dz } |r| dz } t|| } |xjdz c_|d }|d krtj }|d kr|s td | S|r|rt j | | |} n3|rt j| |} nt j| |} |r| St j|}t j| |||} || _ | S) N>brlwz invalid mode z (only r, w, b allowed)rrrlrqrNr;rz!unbuffered streams must be binary) setr'SocketIOr9ioDEFAULT_BUFFER_SIZEBufferedRWPairBufferedReaderBufferedWriter text_encoding TextIOWrappermode) rAr} bufferingrmrnrowritingreadingbinaryrawmoderawbuffertexts rmakefilezsocket.makefile0sW 4yOOO++*OP P++,W 7 sNG 7 sNGtW%   I q==..I >>6 !DEEJ 7ww&&sC;FF W&&sI6FF&&sI6F 6M##H-&'B  rsendfilercv|j||||j} |j} t j|j}|sdSt|p|d}|j} | dkr tdttdrtj} ntj } | j#|tj$d} | j&} t j(} | r| | s t+d|r || z }|dkrn | ||||}|dkrn ||z }| |z } E| | dkr"t|dr|j/|SSS#ttjf$r}t |d}~wwxYw#t$r}t |d}~wwxYw#t,$r | s| Yt$r}| dkr t ||dd}~wwxYw#| dkr t|dr|j/|wxYw)Nri@&non-blocking sockets are not supported PollSelectorTz timed outseek)_check_sendfile_paramsrErUrvUnsupportedOperationr1osfstatst_sizeOSErrorminrcr'hasattr selectorsrSelectSelectorregister EVENT_WRITEselectr TimeoutErrorBlockingIOErrorr)rAfileoffsetcountsocknorEerrfsize blocksizetimeoutselector total_sentselector_select os_sendfilesents r_sendfile_use_sendfilezsocket._sendfile_use_sendfile]s  ' 'fe < <[[]F - -(005qENUG4Ioo'G!|| !IJJy.11$113$335   fi&;&; < <J&ooO++K &ww'?'?*;77u$)J$6 $>>!+*{6669M  199!$"d* 78">>gdF&;&;IIf%%%'<>s#B$;$;< - - -',, - - - -',, -@+!!!&w,O-- ",,,%?? #4C"88!t+,>>gdF&;&;IIf%%&&&&sjF!F4'H< GHF1 F,,F14 G> G  GH 'H) H 2HH  H(H8ctd)Nz,os.sendfile() not available on this platform)r1rArrrs rrzsocket._sendfile_use_sendfiles#>@ @rc~|j||||jdkr td|r|j||rt |dnd}d}|j }|j } |rt ||z |}|dkrnAt||}|sn* ||} || z }| t|kr|| d}nn([||dkr%t|dr|j||zSSS#t$rYcwxYw#|dkr#t|dr|j||zwxYw)Nrri Tr) rrcr'rrreadsend memoryviewlenrr) rArrrrr file_read sock_senddatars r_sendfile_use_sendzsocket._sendfile_use_sends ##D&%88 ??  ! !EF F 6 IIf  (-Ct$$4  II II  /5 #EJ$6 BI A~~!))I"67t "(y#d* #d)++#';DD!&A~~'$"7"7 &:-...#8~+!!! !A~~'$"7"7 &:-.. / / / /s083D, D5 D D D DD+D<c2dt|ddvr td|jtzs td|Ut |t st dj||dkrtdj|dSdS)Nrqr}z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)rPr'rCr> isinstanceintr]formatrs rrzsocket._check_sendfile_paramss gdFC0 0 0CD Dyy;&&JK K  eS))AHHOQQzz AHHOQQz  rcv |j|||S#t$r|j|||cYSwxYwr&)rr1rrs rrzsocket.sendfiles\ " @..tVUC C  @ @ @**4? ? ? ? @s 88c|jdkr|xjdzc_|jr|jdSdS)Nrrs)r9r:rJrGs r_decref_socketioszsocket._decref_socketiossB ==1   MMMQ MM <<< JJLLLL  t|}t||||Sr&)rar7)rdrBrCrDnfds rr r s# b'C &$s ++rsendmsgc  |j|tjtjt jd|fgSNi)rr? SOL_SOCKET SCM_RIGHTSarray)rebuffersfdsflagsaddresss rsend_fdsr)sD ||Gw'9'9    C 5'7&89 9rrrecvmsgc  tjd}|j|tj||jz\}}}}|D]m\}} } |tj ks| tj ks3|j| dt| t| |jzz o|t|||fSr) rrr?CMSG_LENitemsizerr frombytesrlist) rebufsizemaxfdsrrmsgancdatarj cmsg_level cmsg_type cmsg_datas rrecv_fdsr5s kk#$(LL   Vcll2 3%5!WeT07 K K ,J 9g0000Y'BTBT5T5T i)II#i.3<<*GHJKKKDIud**rrsharec$ tddd|S)Nr)r7)infos r fromsharerIs aAt$$rr socketpairc | t}tj|||\}}t ||||j }t ||||j }||fS#t$r t}YqwxYwr&)AF_UNIX NameErrorr=r?rr7r)rBrCrDarqs rrrTs  > ! !!&$61 64 3 64 3!t  ! ! !  !sA**A>=A>c|tkrt}n |tkrt}n t d|t kr t d|dkr t dt |||} |j|df|j|jdd\}}t |||} |jd |j||f|jd|j\}} |j||fS#ttf$rYOwxYw#|jxYw#|jwxYw)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supportedFT)r= _LOCALHOSTAF_INET6 _LOCALHOST_V6r'r>r7bindlistenrRriconnectrInterruptedErrorrkrJ) rBrCrDhostlsockrjportcsockssock_s rrrisz W  DD x   DD-. . ;  HI I A::>? ?vtU+  JJay ! ! LLNN**,Ra0JD$64/E !!%((MM4,//!!$'' <<>qq KKMMu~()9:D   KKMMMMMMsC/A E ;D5D"&D5D2/D51D22D55E  E Ea8socketpair([family[, type[, proto]]]) -> (socket object, socket object) Create a pair of socket objects from the sockets returned by the platform socketpair() function. The arguments are the same as for socket() except the default family is AF_UNIX if defined on the platform; otherwise, the default is AF_INET. cneZdZ dZdZdZdZdZfdZdZ e dZ e d Z d Z xZS) ruc|dvrtd|ztjj|||_d|vr|dz }||_d|v|_d|v|_d|_dS)N)rlrrrwrbwbrwbzinvalid mode: %rrqrlrrF) r'rv RawIOBaser@_sock_mode_reading_writing_timeout_occurred)rArer}s rr@zSocketIO.__init__sx : : :/$67 7 d## d?? CKD t  t  !&rc0 |j|j|jr td |jj |S#t $r d|_t$r}|jtvrYd}~dSd}~wwxYw)Nz!cannot read from timed out objectT) _checkClosed_checkReadablerrr recv_intorrTerrno_blocking_errnosrArqes rreadintozSocketIO.readintos     ! ! !=> > zz++A..   )-&   77...44444 sAB6BBBc |j|j |jj|S#t$r}|j t vrYd}~dSd}~wwxYwr&)r_checkWritablerrrTrrrs rwritezSocketIO.writes~   ::??1% %   ww***ttttt   sA A* A%$A%%A*cN |jr td|jSNzI/O operation on closed socket.)rWr'rrGs rreadablezSocketIO.readable& ;;;>? ?}}rcN |jr td|jSr$)rWr'rrGs rwritablezSocketIO.writabler&rcn |jr tdtjSr$)rWr'rseekablers rr*zSocketIO.seekables. ;;;>? ?w!!rc\ |j|jjSr&)rrrErGs rrEzSocketIO.filenos)  zz  ""rc@|js|jSdS)Nr;)rWrErGs rrz SocketIO.names{{{;;= 2rc|jSr&)rrGs rr}z SocketIO.modes zzrc |jrdStjj||jj d|_dSr&)rWrvrrJrrrGs rrJzSocketIO.closesJ  ;;; F 4   $$&& r)r2r3r4r@rr"r%r(r*rErrr}rJrrs@rrurus ' ' '. """""###  rrurNc |j}|r|dkr t} t|\}}}|jd||D] }d|vs|S|}|S#t$rY|SwxYw)Nz0.0.0.0r.)strip gethostname gethostbyaddrinsertrT)rhostnamealiasesipaddrss rr r s ::r7_GLOBAL_DEFAULT_TIMEOUTrbrrclearrTappendrJrExceptionGroup)rrsource_addressr8rr exceptionsresafsocktyperD canonnamesareexcs rr r *sd JD$J4q+6-0*HeY "h.D555((~ .)) LL       KKK : : m# !;ZH H 788!   :  ""   c " "           s$A"CD D8D  DD&c& tr&ttdrttdsdS ttt 5}|j ttd ddddS#1swYdSxYw#t$rYdSwxYw)N IPPROTO_IPV6 IPV6_V6ONLYFrT) has_ipv6rr?r7rr> setsockoptrHrIrT)res rrr]s 87N337M22u Hk * d OOL+q 9 9                  uus/B A5* B5A?:B?B BB)rBbacklog reuse_portdualstack_ipv6c |r ttds td|r1ts td|tkr tdt |t } tjdvr2ttdr |jttd|r|jttdtrp|tkre|r|jtt dnDttd r1ttd r|jtt d |j#|||j)|S|j)||S#t$rYwxYw#t$r0}|j$d |d }t|j&|dd}~wwxYw#t$r|j+wxYw) N SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)rcygwin SO_REUSEADDRrsrrIrHz& (while attempting to bind on address ))rr?r'rrr7r>rrrKrrRrTrPrJrHrIrstrerrorrrrJ)rrBrLrMrNrerrs rrrms"z''>::FGG~!##LM M X  FG G &+ &D' 77* * *00  L!<< : OOJ a 8 8 8(**~ k1===-00G^44 k1== 2 IIg   ? KKMM  KK  -     2 2 2www(C 3'T 1 2   s[+&GF0BGFG/G F GFG G +GG  GG-c g}tj||||||D]C}|\}} }} } |jt|tt| t || | fE|Sr&)r?r:r=r*rr) rrrBrCrDraddrlistrArBrCrDrEs rr:r:s H""4vtUEJ00-0*HeY+B >+HjA 2/ 0 0 0 Or)rr)rN)rrrr)2r?rsysrvrenumrrr ImportErrorrPrrr __all__extend_get_exports_list _convert_r2rrr*platformlowerrr/r= Exceptionr1r7r rrrrrr>rr=rrrrur objectr;r rrr:r5rrrbs.`!!!!!!!!LLL w" " %ge]B/  @ @ @#r##G,--5577 7799 6688 5577   <<""5))H=HQK2HQK8HRL3HSMHHSM?HSM6HUO5HUO*HUO9HUO;HUO,HUO9HUODHUO6HUO6HUO5HUO)HUO7HUO,HUO/HUO2HUO0HUO6HUOHHUO6HUO8HUO(HUO/HUOHUO,HUO*HUO-HUOBHUO*HUO3HUO'HUO8HUO7HUOBHUO&HUO$HUO'HUO)HUO.HUO,HUO+HUO&HUO'HUO2HUO*HUO/HUO+HUO4HUO1HUO1HUO3HUO2HUO1HUO0HUO2HUO4HUO?HUOAHUO>HUO8HUO9HUO NN:)(((( ((DGDGDGDGDGW^^DGDGL ,,,, 77>>9%%LLL9999 NN: 77>>9%%LLL++++" NN: 77>>7##%%% NN; 77L!![*" 1####H NN<   [*rrrrrr||rrj6!&('>%)099>0909090909f    &-du!&BBBBBJm EEEsPPP