a ÕDOg3ã@sXdZddlZddlTddlZddlZddlZddlZddlmZmZz ddl Z Wne yfdZ Yn0e e ddƒZ e e ddƒZ e e d dƒZgd ¢Ze e e¡¡e d ed d „¡e dedd „¡e dedd „¡e dedd „¡dZdZdd„Zej ¡ d¡riZded<ded<ded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded€<ded‚<dƒed„<d…ed†<d‡edˆ<d‰edŠ<d‹edŒ<dedŽ<ded<d‘ed’<dƒed“<d”ed•<d–ed—<d˜ed™<dšed›<dœed<džedŸ<d ed¡<d¢ed£<d¤ed¥<d¦ed§<d¨ed©<dªed«<d¬ed­<d®ed¯<d°ed±<d²ed³<d´edµ<d¶ed·<d¸ed¹<dºed»<d¼ed½<d¼ed¾<d¿edÀ<dÁedÂ<dÃedÄ<dÅedÆ<dÇedÈ<dÉedÊ<dËedÌ<dÍedÎ<dÏedÐ<dÑedÒ<dÓedÔ<e dÕ¡GdÖdׄd×eƒZGdØdÙ„dÙejƒZdùdÚdÛ„Ze ejd܃rjddl!Z!dúdÝdÞ„Z"e dÞ¡e ejd߃r”ddl!Z!dûdàdá„Z#e dá¡e ejdâƒr´dãdä„Z$e dä¡e%e&dfdådæ„Z'e edçƒrâde&dfdèdç„Z(ne'Z(e dç¡dée(_e ehZ)Gdêdë„dëej*ƒZ+düdídî„Z,e-ƒZ.e.dfdïdð„Z/dñdò„Z0e%ddódódôœdõdö„Z1dýd÷dø„Z2dS)þašThis module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available as methods of the socket object. Functions: socket() -- create a new socket object socketpair() -- create a pair of new socket objects [*] fromfd() -- create a socket object from an open file descriptor [*] send_fds() -- Send file descriptor to the socket. recv_fds() -- Recieve file descriptors from the socket. fromshare() -- create a socket object from data received from socket.share() [*] gethostname() -- return the current hostname gethostbyname() -- map a hostname to its IP number gethostbyaddr() -- map an IP number or hostname to DNS info getservbyname() -- map a service name and a protocol name to a port number getprotobyname() -- map a protocol name (e.g. 'tcp') to a number ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order htons(), htonl() -- convert 16, 32 bit int from host to network byte order inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89) socket.getdefaulttimeout() -- get the default timeout value socket.setdefaulttimeout() -- set the default timeout value create_connection() -- connects to an address, with an optional timeout and optional source address. [*] not available on all platforms! Special objects: SocketType -- type object for socket objects error -- exception raised for I/O errors has_ipv6 -- boolean value indicating if IPv6 is supported IntEnum constants: AF_INET, AF_UNIX -- socket domains (first argument to socket() call) SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument) Integer constants: Many other constants may be defined; these may be used in calls to the setsockopt() and getsockopt() methods. éN)Ú*)ÚIntEnumÚIntFlagÚEBADFé ÚEAGAINé Ú EWOULDBLOCK)ÚfromfdÚgetfqdnÚcreate_connectionÚ create_serverÚhas_dualstack_ipv6Ú AddressFamilyÚ SocketKindrcCs| ¡o| d¡S)NZAF_©ÚisupperÚ startswith©ÚC©rú+/opt/alt/python39/lib64/python3.9/socket.pyÚNórrcCs| ¡o| d¡S)NZSOCK_rrrrrrSrZMsgFlagcCs| ¡o| d¡S)NZMSG_rrrrrrXrZ AddressInfocCs| ¡o| d¡S)NZAI_rrrrrr]rz 127.0.0.1z::1cCs&z ||ƒWSty |YS0dS)z{Convert a numeric family value to an IntEnum member. If it's not a known member, return the numeric value itself. N)Ú ValueError)ÚvalueZ enum_klassrrrÚ_intenum_convertercs  rÚwinz)Specified event object handle is invalid.ézInsufficient memory available.éz#One or more parameters are invalid.éWzOverlapped operation aborted.iãz2Overlapped I/O event object not in signaled state.iäz)Overlapped operation will complete later.iåzThe 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 blocki3'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+ÚerrorTabc@s eZdZdS)Ú_GiveupOnSendfileN)Ú__name__Ú __module__Ú __qualname__rrrrr"Órr"cs*eZdZdZgd¢Zd7dd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z d8ddddœdd„Z e edƒrxd9dd„Zn d:dd„Zd;dd„Zdd„Zd) ÚgetattrÚ __class__r$r%r3r0r1r2Ú getsocknameÚstrÚerrorÚ getpeername)r/ÚclosedÚsZladdrZraddrrrrÚ__repr__ós4  úÿ  zsocket.__repr__cCstd|jj›dƒ‚dS)Nzcannot pickle z object)Ú TypeErrorr=r#r5rrrÚ __getstate__szsocket.__getstate__cCs6t| ¡ƒ}|j|j|j|j|d}| | ¡¡|S)z«dup() -> socket object Duplicate the socket. Return a new socket object connected to the same system resource. The new socket is non-inheritable. ©r3)Údupr3r=r0r1r2Ú settimeoutÚ gettimeout)r/ÚfdÚsockrrrrHs z socket.dupcCsF| ¡\}}t|j|j|j|d}tƒdur>| ¡r>| d¡||fS)zúaccept() -> (socket object, address info) Wait for an incoming connection. Return a new socket representing the connection, and the address of the client. For IP sockets, the address info is a pair (hostaddr, port). rGNT)Z_acceptr&r0r1r2ZgetdefaulttimeoutrJÚ setblocking)r/rKÚaddrrLrrrÚaccepts   z socket.acceptÚr)ÚencodingÚerrorsÚnewlinec Cst|ƒhd£kstd|fƒ‚d|v}d|vp2| }|s@|s@J‚d|v}d} |rX| d7} |rd| d7} t|| ƒ} |jd7_|durˆd }|d kr–tj}|d kr®|sªtd ƒ‚| S|rÆ|rÆt | | |¡} n&|rØt | |¡} n|sàJ‚t | |¡} |rô| St  | |||¡} || _ | S) zÍmakefile(...) -> an I/O stream connected to the socket The arguments are as for io.open() after the filename, except the only supported mode values are 'r' (default), 'w' and 'b'. >ÚwÚbrPz&invalid mode %r (only r, w, b allowed)rTrPrUr:éNr*rz!unbuffered streams must be binary) ÚsetrÚSocketIOr(ÚioÚDEFAULT_BUFFER_SIZEÚBufferedRWPairÚBufferedReaderÚBufferedWriterÚ TextIOWrapperÚmode) r/r_Ú bufferingrQrRrSZwritingZreadingZbinaryZrawmodeÚrawÚbufferÚtextrrrÚmakefile.s@   zsocket.makefileÚsendfilerc Cs| |||¡| ¡}z | ¡}Wn2ttjfyT}zt|ƒ‚WYd}~n d}~00zt |¡j}Wn,t y’}zt|ƒ‚WYd}~n d}~00|sœdSt |p¤|dƒ}|  ¡} | dkrÂt dƒ‚t tdƒrÖt ¡} nt ¡} |  |tj¡d} | j} tj} zö| r| | ƒst d¡‚|r6|| }|dkr6qÎz| ||||ƒ}Wnbtyn| sd| ƒYqYn\t yª}z$| dkrt|ƒ‚|d‚WYd}~n(d}~00|dkrºqÎ||7}| |7} q| W| dkròt |dƒrò| |¡Sn"| dkrt |dƒr| |¡0dS)Nri@ú&non-blocking sockets are not supportedÚ PollSelectorz timed outÚseek)Ú_check_sendfile_paramsr3ÚAttributeErrorrYÚUnsupportedOperationr"ÚosÚfstatÚst_sizeÚOSErrorÚminrJrÚhasattrÚ selectorsrgZSelectSelectorÚregisterZ EVENT_WRITEZselectrer-ÚtimeoutÚBlockingIOErrorrh)r/ÚfileÚoffsetÚcountZsocknor3ÚerrZfsizeÚ blocksizertZselectorÚ total_sentZselector_selectZ os_sendfileÚsentrrrÚ_sendfile_use_sendfileZsh          ýÿzsocket._sendfile_use_sendfilecCs tdƒ‚dS)Nz,os.sendfile() not available on this platform)r"©r/rvrwrxrrrr}›sÿc Cs | |||¡| ¡dkr"tdƒ‚|r0| |¡|r>t|dƒnd}d}|j}|j}z¢|rpt|||ƒ}|dkrpqÎt||ƒƒ}|s‚qÎz ||ƒ} Wnty¤Yq‚Yq‚0|| 7}| t |ƒkrÌ|| d…}q‚qTq‚qT|W|dkròt |dƒrò| ||¡Sn&|dkrt |dƒr| ||¡0dS)Nrrfi rh) rirJrrhrpÚreadÚsendÚ memoryviewruÚlenrq) r/rvrwrxrzr{Z file_readZ sock_sendÚdatar|rrrÚ_sendfile_use_sendŸsB       ýÿzsocket._sendfile_use_sendcCsddt|ddƒvrtdƒ‚|jt@s*tdƒ‚|dur`t|tƒsJtd |¡ƒ‚|dkr`td |¡ƒ‚dS)NrUr_z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr1r,Ú isinstanceÚintrEÚformatr~rrrriÃs  ÿÿzsocket._check_sendfile_paramscCs6z| |||¡WSty0| |||¡YS0dS)a_sendfile(file[, offset[, count]]) -> sent Send a file until EOF is reached by using high-performance os.sendfile() and return the total number of bytes which were sent. *file* must be a regular file object opened in binary mode. If os.sendfile() is not available (e.g. Windows) or file is not a regular file socket.send() will be used instead. *offset* tells from where to start reading the file. If specified, *count* is the total number of bytes to transmit as opposed to sending the file until EOF is reached. File position is updated on return or also in case of error in which case file.tell() can be used to figure out the number of bytes which were sent. The socket must be of SOCK_STREAM type. Non-blocking sockets are not supported. N)r}r"r„r~rrrreÐs zsocket.sendfilecCs*|jdkr|jd8_|jr&| ¡dS)NrrV)r(r)r7r5rrrÚ_decref_socketiosçs zsocket._decref_socketioscCs| |¡dSr4)r7)r/Z_ssrrrÚ _real_closeíszsocket._real_closecCsd|_|jdkr| ¡dS)NTr)r)r(r‰r5rrrr7ñs z socket.closecsd|_tƒ ¡S)a detach() -> file descriptor Close the socket object without closing the underlying file descriptor. The object cannot be used after this call, but the file descriptor can be reused for other purposes. The file descriptor is returned. T)r)ÚsuperÚdetachr5©r=rrr‹÷sz socket.detachcsttƒjtƒS)z@Read-only access to the address family for this socket. )rrŠr0rr5rŒrrr0sz socket.familycsttƒjtƒS)z-Read-only access to the socket type. )rrŠr1rr5rŒrrr1sz socket.typeÚntcCst | ¡¡Sr4)rlZget_handle_inheritabler3r5rrrÚget_inheritableszsocket.get_inheritablecCst | ¡|¡dSr4)rlZset_handle_inheritabler3©r/Z inheritablerrrÚset_inheritableszsocket.set_inheritablecCst | ¡¡Sr4)rlrŽr3r5rrrrŽscCst | ¡|¡dSr4)rlrr3rrrrrsz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r*r*r*N)rPN)rN)rN)rN)rN) r#r$r%Ú__doc__Ú __slots__r.r6r9rDrFrHrOrdrqrlr}r„rirerˆr-r&r‰r7r‹Úpropertyr0r1ÚnamerŽrÚ __classcell__rrrŒrr&ÖsB  ÿ *  A  $    r&cCst|ƒ}t||||ƒS)z¾ fromfd(fd, family, type[, proto]) -> socket object Create a socket object from a duplicate of the given file descriptor. The remaining arguments are the same as for socket(). )rHr&)rKr0r1r2Znfdrrrr sr Úsendmsgc Cs | |tjtjt d|¡fg¡S)zŒ send_fds(sock, buffers, fds[, flags[, address]]) -> integer Send the list of file descriptors fds over an AF_UNIX socket. Úi)r–r-Ú SOL_SOCKETÚ SCM_RIGHTSÚarray)rLZbuffersÚfdsÚflagsÚaddressrrrÚsend_fds&s ÿržÚrecvmsgc Cs‚t d¡}| |t ||j¡¡\}}}}|D]B\}} } |tjkr.| tjkr.| | dt| ƒt| ƒ|j…¡q.|t |ƒ||fS)zë recv_fds(sock, bufsize, maxfds[, flags]) -> (data, list of file descriptors, msg_flags, address) Receive up to maxfds file descriptors returning the message data and a list containing the descriptors. r—N) ršrŸr-ZCMSG_LENÚitemsizer˜r™Z frombytesr‚Úlist) rLÚbufsizeZmaxfdsrœr›ÚmsgZancdatarNZ cmsg_levelZ cmsg_typeZ cmsg_datarrrÚrecv_fds2s ÿ ÿ r¤ZsharecCstddd|ƒS)z‡ fromshare(info) -> socket object Create a socket object from the bytes object returned by socket.share(pid). r)r&)ÚinforrrÚ fromshareFsr¦c Cs\|tkrt}n|tkrt}ntdƒ‚|tkr4tdƒ‚|dkrDtdƒ‚t|||ƒ}z¨| |df¡| ¡|  ¡dd…\}}t|||ƒ}zN|  d¡z|  ||f¡Wnt t fy¼Yn0|  d¡| ¡\}} Wn| ¡‚Yn0W| ¡n | ¡0z0|  ¡| ¡ks*|  ¡| ¡kr2tdƒ‚Wn| ¡| ¡‚Yn0||fS) Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supportedéFTzUnexpected peer connection)r+Ú _LOCALHOSTÚAF_INET6Ú _LOCALHOST_V6rr,r&ÚbindÚlistenr>rMÚconnectruÚInterruptedErrorrOr7rAÚConnectionError) r0r1r2ÚhostZlsockrNÚportZcsockZssockÚ_rrrÚ_fallback_socketpairRsL     ÿþ r³Ú socketpaircCsf|dur(zt}Wnty&t}Yn0t |||¡\}}t|||| ¡ƒ}t|||| ¡ƒ}||fSr4)ZAF_UNIXÚ NameErrorr+r-r´r&r‹)r0r1r2ÚarUrrrr´‰s  a8socketpair([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. cspeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Z‡fd d „Z dd„Z e dd„ƒZ e dd„ƒZ dd„Z‡ZS)rXz¬Raw I/O implementation for stream sockets. This class supports the makefile() method on sockets. It provides the raw I/O interface on top of a socket object. cCsZ|dvrtd|ƒ‚tj |¡||_d|vr6|d7}||_d|v|_d|v|_d|_dS)N)rPrTZrwÚrbÚwbZrwbzinvalid mode: %rrUrPrTF) rrYÚ RawIOBaser.Ú_sockÚ_modeÚ_readingÚ_writingÚ_timeout_occurred)r/rLr_rrrr.²s    zSocketIO.__init__c CsŽ| ¡| ¡|jrtdƒ‚z|j |¡WStyFd|_‚Yqty†}z*|jdt vrpWYd}~dS‚WYd}~qd}~00qdS)a3Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other end. z!cannot read from timed out objectTrN) Ú _checkClosedÚ_checkReadabler¾rorºZ recv_intortr@r8Ú_blocking_errnos©r/rUÚerrrÚreadinto¾s zSocketIO.readintoc Csf| ¡| ¡z|j |¡WSty`}z*|jdtvrJWYd}~dS‚WYd}~n d}~00dS)aWrite the given bytes or bytearray object *b* to the socket and return the number of bytes written. This can be less than len(b) if not all data could be written. If the socket is non-blocking and no bytes could be written None is returned. rN)r¿Ú_checkWritablerºr€r@r8rÁrÂrrrÚwriteÕszSocketIO.writecCs|jrtdƒ‚|jS)z2True if the SocketIO is open for reading. úI/O operation on closed socket.)rBrr¼r5rrrÚreadableåszSocketIO.readablecCs|jrtdƒ‚|jS)z2True if the SocketIO is open for writing. rÇ)rBrr½r5rrrÚwritableìszSocketIO.writablecs|jrtdƒ‚tƒ ¡S)z2True if the SocketIO is open for seeking. rÇ)rBrrŠÚseekabler5rŒrrrÊószSocketIO.seekablecCs| ¡|j ¡S)z=Return the file descriptor of the underlying socket. )r¿rºr3r5rrrr3úszSocketIO.filenocCs|js| ¡SdSdS)Nr*)rBr3r5rrrr”sz SocketIO.namecCs|jSr4)r»r5rrrr_sz SocketIO.modecCs*|jr dStj |¡|j ¡d|_dS)z‡Close the SocketIO object. This doesn't close the underlying socket, except if all references to it have disappeared. N)rBrYr¹r7rºrˆr5rrrr7 s   zSocketIO.close)r#r$r%r‘r.rÄrÆrÈrÉrÊr3r“r”r_r7r•rrrŒrrX¡s    rXr:cCsj| ¡}|r|dkrtƒ}zt|ƒ\}}}Wnty>Yn(0| d|¡|D]}d|vrPqfqP|}|S)atGet fully qualified domain name from name. An empty argument is interpreted as meaning the local host. First the hostname returned by gethostbyaddr() is checked, then possibly existing aliases. In case no FQDN is available and `name` was given, it is returned unchanged. If `name` was empty or '0.0.0.0', hostname from gethostname() is returned. z0.0.0.0rÚ.)ÚstripZ gethostnameZ gethostbyaddrr@Úinsert)r”ZhostnameÚaliasesZipaddrsrrrr s    r c CsÚ|\}}d}t||dtƒD]”}|\}}} } } d} zDt||| ƒ} |turP|  |¡|r^|  |¡|  | ¡d}| WSty¬} z | }| dur˜|  ¡WYd} ~ qd} ~ 00q|durÎz |‚Wd}qÖd}0ntdƒ‚dS)acConnect to *address* and return the socket object. Convenience function. Connect to *address* (a 2-tuple ``(host, port)``) and return the socket object. Passing the optional *timeout* parameter will set the timeout on the socket instance before attempting to connect. If no *timeout* is supplied, the global default timeout setting returned by :func:`getdefaulttimeout` is used. If *source_address* is set it must be a tuple of (host, port) for the socket to bind as a source address before making the connection. A host of '' or port 0 tells the OS to use the default. Nrz!getaddrinfo returns an empty list) Ú getaddrinfor,r&Ú_GLOBAL_DEFAULT_TIMEOUTrIr«r­r@r7)rrtZsource_addressr°r±ryÚresÚafÚsocktyper2Ú canonnameÚsarLr²rrrr 3s.      r cCsvtrttdƒrttdƒsdSz@tttƒ"}| ttd¡WdƒWdS1sP0YWnt ypYdS0dS)z‘Return True if the platform supports creating a SOCK_STREAM socket which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections. Ú IPPROTO_IPV6Ú IPV6_V6ONLYFrNT) Úhas_ipv6rqr-r&r©r,Ú setsockoptrÖr×r@)rLrrrr`sÿþ & rF)r0ÚbacklogÚ reuse_portÚdualstack_ipv6c Csl|rttdƒstdƒ‚|r8tƒs(tdƒ‚|tkr8tdƒ‚t|tƒ}ztjdvr€ttdƒr€z|  t t d¡Wnt y~Yn0|r’|  t t d¡trÔ|tkrÔ|r²|  ttd¡n"ttd ƒrÔttd ƒrÔ|  ttd¡z| |¡WnBt y$}z(d |j|f}t |j|ƒd ‚WYd }~n d }~00|d ur:| ¡n | |¡|WSt yf| ¡‚Yn0d S) aêConvenience function which creates a SOCK_STREAM type socket bound to *address* (a 2-tuple (host, port)) and return the socket object. *family* should be either AF_INET or AF_INET6. *backlog* is the queue size passed to socket.listen(). *reuse_port* dictates whether to use the SO_REUSEPORT socket option. *dualstack_ipv6*: if true and the platform supports it, it will create an AF_INET6 socket able to accept both IPv4 or IPv6 connections. When false it will explicitly disable this option on platforms that enable it by default (e.g. Linux). >>> with create_server(('', 8000)) as server: ... while True: ... conn, addr = server.accept() ... # handle new connection Ú SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)rÚcygwinÚ SO_REUSEADDRrVrr×rÖz+%s (while attempting to bind on address %r)N)rqr-rrr©r&r,rlr”rÙr˜rßr@rÝrØrÖr×r«ÚstrerrorÚerrnor¬r7)rr0rÚrÛrÜrLryr£rrrr psN  ÿ   ÿÿ$   r c CsPg}t ||||||¡D]2}|\}} }} } | t|tƒt| tƒ|| | f¡q|S)aºResolve host and port into list of address info entries. Translate the host/port argument into a sequence of 5-tuples that contain all the necessary arguments for creating a socket connected to that service. host is a domain name, a string representation of an IPv4/v6 address or None. port is a string service name such as 'http', a numeric port number or None. By passing None as the value of host and port, you can pass NULL to the underlying C API. The family, type and proto arguments can be optionally specified in order to narrow the list of addresses returned. Passing zero as a value for each of these arguments selects the full range of results. )r-rÏÚappendrrr) r°r±r0r1r2rœZaddrlistrÑrÒrÓrÔrÕrrrrϵs þrÏ)r)rN)r)r:)rrrr)3r‘r-rlÚsysrYrrÚenumrrráÚ ImportErrorr<rrr Ú__all__ÚextendÚ_get_exports_listÚ _convert_r#r¨rªrÚplatformÚlowerrr!râÚ Exceptionr"r&r rqršržr¤r¦r+r,r³r´rÁr¹rXr ÚobjectrÐr rr rÏrrrrÚsP/       ýýýý  F      6   u ÿ -ÿ E