/snap/core24/1587/usr/lib/python3.12/__pycache__
NameSizeModeActions
abc.cpython-312.pyc80550644editdlrm
aifc.cpython-312.pyc428630644editdlrm
antigravity.cpython-312.pyc10030644editdlrm
argparse.cpython-312.pyc1016820644editdlrm
ast.cpython-312.pyc1002790644editdlrm
base64.cpython-312.pyc244080644editdlrm
bdb.cpython-312.pyc373590644editdlrm
bisect.cpython-312.pyc36410644editdlrm
bz2.cpython-312.pyc151330644editdlrm
calendar.cpython-312.pyc396210644editdlrm
cgi.cpython-312.pyc402280644editdlrm
cgitb.cpython-312.pyc173320644editdlrm
chunk.cpython-312.pyc73100644editdlrm
cmd.cpython-312.pyc186190644editdlrm
code.cpython-312.pyc130510644editdlrm
codecs.cpython-312.pyc422740644editdlrm
codeop.cpython-312.pyc69160644editdlrm
colorsys.cpython-312.pyc46420644editdlrm
compileall.cpython-312.pyc204970644editdlrm
configparser.cpython-312.pyc635820644editdlrm
contextlib.cpython-312.pyc303760644editdlrm
contextvars.cpython-312.pyc2610644editdlrm
copy.cpython-312.pyc98000644editdlrm
copyreg.cpython-312.pyc74140644editdlrm
cProfile.cpython-312.pyc85930644editdlrm
crypt.cpython-312.pyc53610644editdlrm
csv.cpython-312.pyc177880644editdlrm
dataclasses.cpython-312.pyc446780644editdlrm
datetime.cpython-312.pyc4090644editdlrm
decimal.cpython-312.pyc4060644editdlrm
difflib.cpython-312.pyc754990644editdlrm
dis.cpython-312.pyc345600644editdlrm
doctest.cpython-312.pyc1056860644editdlrm
enum.cpython-312.pyc807080644editdlrm
filecmp.cpython-312.pyc146610644editdlrm
fileinput.cpython-312.pyc202800644editdlrm
fnmatch.cpython-312.pyc64950644editdlrm
fractions.cpython-312.pyc366670644editdlrm
ftplib.cpython-312.pyc426360644editdlrm
functools.cpython-312.pyc405060644editdlrm
genericpath.cpython-312.pyc68220644editdlrm
getopt.cpython-312.pyc83630644editdlrm
getpass.cpython-312.pyc68500644editdlrm
gettext.cpython-312.pyc221510644editdlrm
glob.cpython-312.pyc98410644editdlrm
graphlib.cpython-312.pyc103270644editdlrm
gzip.cpython-312.pyc320150644editdlrm
hashlib.cpython-312.pyc80870644editdlrm
heapq.cpython-312.pyc179560644editdlrm
hmac.cpython-312.pyc106980644editdlrm
imaplib.cpython-312.pyc628890644editdlrm
imghdr.cpython-312.pyc69440644editdlrm
inspect.cpython-312.pyc1334460644editdlrm
io.cpython-312.pyc41390644editdlrm
ipaddress.cpython-312.pyc907620644editdlrm
keyword.cpython-312.pyc10410644editdlrm
linecache.cpython-312.pyc64010644editdlrm
locale.cpython-312.pyc595360644editdlrm
lzma.cpython-312.pyc158550644editdlrm
mailbox.cpython-312.pyc1116180644editdlrm
mailcap.cpython-312.pyc111550644editdlrm
mimetypes.cpython-312.pyc241850644editdlrm
modulefinder.cpython-312.pyc279440644editdlrm
netrc.cpython-312.pyc89030644editdlrm
nntplib.cpython-312.pyc449390644editdlrm
ntpath.cpython-312.pyc260330644editdlrm
nturl2path.cpython-312.pyc30340644editdlrm
numbers.cpython-312.pyc139670644editdlrm
opcode.cpython-312.pyc147160644editdlrm
operator.cpython-312.pyc173640644editdlrm
optparse.cpython-312.pyc675460644editdlrm
os.cpython-312.pyc434740644editdlrm
pathlib.cpython-312.pyc620980644editdlrm
pdb.cpython-312.pyc849190644editdlrm
pickle.cpython-312.pyc761760644editdlrm
pickletools.cpython-312.pyc811280644editdlrm
pipes.cpython-312.pyc109140644editdlrm
pkgutil.cpython-312.pyc199590644editdlrm
platform.cpython-312.pyc416000644editdlrm
plistlib.cpython-312.pyc412860644editdlrm
poplib.cpython-312.pyc184460644editdlrm
posixpath.cpython-312.pyc182360644editdlrm
pprint.cpython-312.pyc294740644editdlrm
profile.cpython-312.pyc225400644editdlrm
pstats.cpython-312.pyc379220644editdlrm
pty.cpython-312.pyc73630644editdlrm
pyclbr.cpython-312.pyc148870644editdlrm
pydoc.cpython-312.pyc1429550644editdlrm
py_compile.cpython-312.pyc100780644editdlrm
queue.cpython-312.pyc147320644editdlrm
quopri.cpython-312.pyc93230644editdlrm
random.cpython-312.pyc331530644editdlrm
reprlib.cpython-312.pyc99090644editdlrm
rlcompleter.cpython-312.pyc82820644editdlrm
runpy.cpython-312.pyc143850644editdlrm
sched.cpython-312.pyc77350644editdlrm
secrets.cpython-312.pyc25560644editdlrm
selectors.cpython-312.pyc261280644editdlrm
shelve.cpython-312.pyc129130644editdlrm
shlex.cpython-312.pyc141620644editdlrm
shutil.cpython-312.pyc681130644editdlrm
signal.cpython-312.pyc44480644editdlrm
site.cpython-312.pyc290630644editdlrm
sitecustomize.cpython-312.pyc3000644editdlrm
smtplib.cpython-312.pyc482210644editdlrm
sndhdr.cpython-312.pyc107120644editdlrm
socket.cpython-312.pyc418170644editdlrm
socketserver.cpython-312.pyc342580644editdlrm
sre_compile.cpython-312.pyc6250644editdlrm
sre_constants.cpython-312.pyc6280644editdlrm
sre_parse.cpython-312.pyc6210644editdlrm
ssl.cpython-312.pyc630110644editdlrm
stat.cpython-312.pyc52310644editdlrm
statistics.cpython-312.pyc554230644editdlrm
string.cpython-312.pyc114820644editdlrm
stringprep.cpython-312.pyc251600644editdlrm
struct.cpython-312.pyc3250644editdlrm
subprocess.cpython-312.pyc791870644editdlrm
sunau.cpython-312.pyc254230644editdlrm
symtable.cpython-312.pyc187810644editdlrm
sysconfig.cpython-312.pyc300010644editdlrm
tabnanny.cpython-312.pyc121560644editdlrm
tarfile.cpython-312.pyc1233880644editdlrm
telnetlib.cpython-312.pyc284230644editdlrm
tempfile.cpython-312.pyc473390644editdlrm
textwrap.cpython-312.pyc182930644editdlrm
this.cpython-312.pyc14080644editdlrm
threading.cpython-312.pyc653460644editdlrm
timeit.cpython-312.pyc148640644editdlrm
token.cpython-312.pyc35570644editdlrm
tokenize.cpython-312.pyc247750644editdlrm
trace.cpython-312.pyc330240644editdlrm
traceback.cpython-312.pyc515230644editdlrm
tracemalloc.cpython-312.pyc269070644editdlrm
tty.cpython-312.pyc26680644editdlrm
turtle.cpython-312.pyc1846320644editdlrm
types.cpython-312.pyc149390644editdlrm
typing.cpython-312.pyc1418600644editdlrm
uu.cpython-312.pyc78160644editdlrm
uuid.cpython-312.pyc330070644editdlrm
warnings.cpython-312.pyc237920644editdlrm
wave.cpython-312.pyc320840644editdlrm
weakref.cpython-312.pyc313480644editdlrm
webbrowser.cpython-312.pyc263530644editdlrm
xdrlib.cpython-312.pyc118410644editdlrm
zipapp.cpython-312.pyc99770644editdlrm
zipimport.cpython-312.pyc244750644editdlrm
_aix_support.cpython-312.pyc47590644editdlrm
_collections_abc.cpython-312.pyc459120644editdlrm
_compat_pickle.cpython-312.pyc72210644editdlrm
_compression.cpython-312.pyc74970644editdlrm
_distutils_system_mod.cpython-312.pyc78180644editdlrm
_markupbase.cpython-312.pyc122790644editdlrm
_osx_support.cpython-312.pyc177310644editdlrm
_pydatetime.cpython-312.pyc941930644editdlrm
_pydecimal.cpython-312.pyc2278070644editdlrm
_pyio.cpython-312.pyc1102690644editdlrm
_pylong.cpython-312.pyc99830644editdlrm
_py_abc.cpython-312.pyc70540644editdlrm
_sitebuiltins.cpython-312.pyc47600644editdlrm
_strptime.cpython-312.pyc241160644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-312.pyc586510644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-312.pyc586450644editdlrm
_threading_local.cpython-312.pyc82950644editdlrm
_weakrefset.cpython-312.pyc117510644editdlrm
__future__.cpython-312.pyc47040644editdlrm
__hello__.cpython-312.pyc8700644editdlrm
Edit: /snap/core24/1587/usr/lib/python3.12/__pycache__/socket.cpython-312.pyc (41817B)
Цi#dZddlZddlddlZddlZddlZddlZddlmZmZ ddl Z e e ddZ e e ddZ e e d dZgd Zej!ej"eej$d ed ej$d edej$dedej$deddZdZdZej.j1j3driZded<ded<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<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<ej7dӫGdԄdeZGdքdej<Zdd؄Ze ej<d٫rddl!Z!ddڄZ"ej7d۫e ej<dܫrddl!Z!dd݄Z#ej7dޫe ej<d߫rdZ$ej7de edrde%dfdZ&ne'e%dfdZ&ej7dde&_e ehZ(GddejRZ*ddZ+e,Z-e-dfdddZ.dZ/e'dddddZ0ddZ1y#e $rdZ YwxYw)aThis 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() -- Receive 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. create_server() -- create a TCP socket and bind it to a specified 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)*)IntEnumIntFlagEBADF EAGAIN EWOULDBLOCK)fromfdgetfqdncreate_connection create_serverhas_dualstack_ipv6 AddressFamily SocketKindrcH|jxr|jdS)NAF_isupper startswithCs /usr/lib/python3.12/socket.pyrO!))+5!,,u"5rcH|jxr|jdS)NSOCK_rrs rrrTs!))+7!,,w"7rMsgFlagcH|jxr|jdS)NMSG_rrs rrrYs!))+6!,,v"6r AddressInfocH|jxr|jdS)NAI_rrs rrr^rrz 127.0.0.1z::1c6 ||S#t$r|cYSwxYw)z{Convert a numeric family value to an IntEnum member. If it's not a known member, return the numeric value itself. ) ValueError)value enum_klasss r_intenum_converterr)ds& %   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+errorTabc eZdZy)_GiveupOnSendfileN)__name__ __module__ __qualname__rrr0r0srr0cHeZdZdZgdZd dZdZdZdZdZ d Z d Z d!dddd d Z e ed rd"dZnd"dZd"dZdZd"dZdZej*fdZdZfdZefdZefdZej8dk(rdZdZndZdZde_de_xZS)#socketz:A subclass of _socket.socket adding the makefile() method.) __weakref___io_refs_closedNc||dk(rt}|dk(rt}|dk(rd}tjj |||||d|_d|_y)NrF)AF_INET SOCK_STREAM_socketr6__init__r8r9)selffamilytypeprotofilenos rr?zsocket.__init__sU >| rz"{fdE6B  rc|SNr4r@s r __enter__zsocket.__enter__s rc>|js|jyyrF)r9close)r@argss r__exit__zsocket.__exit__s|| JJLrct|dd}d|jj|jj|rdnd|j |j |j |jfz}|sH |j}|r|dt|zz } |j}|r|dt|zz }|dz }|S#ttf$rY) getattr __class__r2r3rDrArBrC getsocknamestrerrorAttributeError getpeername)r@closedsladdrraddrs r__repr__zsocket.__repr__sy%0 :~~((~~**${"{{}{{yyzz   ((*E 22A ((*E 22A S>*   >*  s$5#C#CCCC*)C*cHtd|jjd)Nzcannot pickle z object) TypeErrorrQr1rGs r __getstate__zsocket.__getstate__s!.)@)@(C7KLLrct|j}|j|j|j|j |}|j |j|S)zdup() -> socket object Duplicate the socket. Return a new socket object connected to the same system resource. The new socket is non-inheritable. rD)duprDrQrArBrC settimeout gettimeout)r@fdsocks rraz socket.dupsN  ~~dkk499djj~L )* rc|j\}}t|j|j|j|}t !|j r|jd||fS)zaccept() -> (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). r`T)_acceptr6rArBrCgetdefaulttimeoutrc setblocking)r@rdaddrres racceptz socket.accept s[<<>Ddkk499djjD   &4??+<   T "Tzr)encodingerrorsnewlinec<t|hdkstd|dd|v}d|vxs| }|s|sJd|v}d} |r| dz } |r| dz } t|| } |xjdz c_|d }|d krtj }|d k(r|s td | S|r|rt j | | |} n3|rt j| |} n|sJt j| |} |r| St j|}t j| |||} || _ | S) zmakefile(...) -> 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'. >brwz invalid mode z (only r, w, b allowed)rrrqrprNr;rz!unbuffered streams must be binary) setr&SocketIOr8ioDEFAULT_BUFFER_SIZEBufferedRWPairBufferedReaderBufferedWriter text_encoding TextIOWrappermode) r@r} bufferingrlrmrnwritingreadingbinaryrawmoderawbuffertexts rmakefilezsocket.makefile0s;4yO+OP P++,W'!!  sNG  sNGtW%   I q=..I > !DEEJ w&&sC;F &&sI6FN7&&sI6F M##H-&'B  rsendfilec0|j||||j} |j} t j|j}|syt|xs|d}|j} | dk(r tdttdrtj} ntj } | j#|tj$d} | j&} t j(} | r| | s t+d|rt|| z |}|dkrn | ||||}|dk(rn ||z }| |z } I| | dkDrt|dr|j/|SSS#ttjf$r}t |d}~wwxYw#t$r}t |d}~wwxYw#t,$r | s| Yt$r}| dk(r t ||dd}~wwxYw#| dkDrt|dr|j/|wwwxYw)Nri@&non-blocking sockets are not supported PollSelectorz timed outseek)_check_sendfile_paramsrDrUrvUnsupportedOperationr0osfstatst_sizeOSErrorminrcr&hasattr selectorsrSelectSelectorregister EVENT_WRITEselectr TimeoutErrorBlockingIOErrorr)r@fileoffsetcountsocknorDerrfsize blocksizetimeoutselector total_sentselector_select os_sendfilesents r_sendfile_use_sendfilezsocket._sendfile_use_sendfile]s  ' 'fe <[[]F - -(00ENUG4Ioo'G!| !IJJy.1$113$335   fi&;&; <J&ooO++K &w'?*;77$' (:I$F $>!+*6669M  19!$"d* 78">gdF&;IIf%'<>s#B$;$;< -',, - -',, -@+!&,- ",%? #4C"88!t+,>gdF&;IIf%'<>sjE0F-G/. F89G/0F FF F5% F00F58G, G/ G,G''G,,G//&Hctd)Nz,os.sendfile() not available on this platform)r0r@rrrs rrzsocket._sendfile_use_sendfiles#>@ @rcL|j||||jdk(r td|r|j||r t |dnd}d}|j }|j } |rt ||z |}|dkrn:t||}|sn& ||} || z }| t|kr|| d}nn$Q||dkDr"t|dr|j||zSSS#t$rYZwxYw#|dkDr"t|dr|j||zwwwxYw)Nrri r) rrcr&rrreadsend memoryviewlenrr) r@rrrrr file_read sock_senddatars r_sendfile_use_sendzsocket._sendfile_use_sendsM ##D&%8 ??  !EF F  IIf (-Ct$4  II II  / #EJ$6 BI A~!)I"67 "(#d* #d)+#';D!&A~'$"7 &:-.#8~+! !A~'$"7 &:-.#8~s00-C:C+&C:+ C74C:6C77C::)D#c dt|ddvr td|jtzs td|Jt |t st dj||dkrtdj|yy)Nrpr}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&rBr= isinstanceintr]formatrs rrzsocket._check_sendfile_paramss gdFC0 0CD Dyy;&JK K  eS)AHHOQQz AHHOQQ rcn |j|||S#t$r|j|||cYSwxYw)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. )rr0rrs rrzsocket.sendfilesC$ @..tVUC C  @**4? ? @s 44c|jdkDr|xjdzc_|jr|jyy)Nrrs)r8r9rJrGs r_decref_socketioszsocket._decref_socketioss1 ==1  MMQ M << JJL rc&|j|yrF)rJ)r@_sss r _real_closezsocket._real_closes  $rcRd|_|jdkr|jyy)NTr)r9r8rrGs rrJz socket.closes& ==A      rc.d|_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)r9superdetachr@rQs rrz socket.detachs w~rc4tt|tS)z@Read-only access to the address family for this socket. )r)rrArrs rrAz socket.familys"%'.-@@rc4tt|tS)z-Read-only access to the socket type. )r)rrBrrs rrBz socket.type s"%', ;;rntcHtj|jSrF)rget_handle_inheritablerDrGs rget_inheritablezsocket.get_inheritables,,T[[]; ;rcLtj|j|yrF)rset_handle_inheritablerDr@ inheritables rset_inheritablezsocket.set_inheritables  % %dkkm[ ArcHtj|jSrF)rrrDrGs rrzsocket.get_inheritables%%dkkm4 4rcLtj|j|yrF)rrrDrs rrzsocket.set_inheritables   t{{}k :rz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r;r;r;N)rqNrN) r1r2r3__doc__ __slots__r?rHrLr[r^rarkrrrrrrrrr>r6rrJrpropertyrArBnamerr __classcell__rQs@rr6r6sD6I <M  )tT)Vr:? &B @"/H Q@. &nn  AA <<  ww$ < B 5 ;FOFOrr6c4t|}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(). )rar6)rdrArBrCnfds rr r s b'C &$s ++rsendmsgc |j|tjtjt jd|fgS)z send_fds(sock, buffers, fds[, flags[, address]]) -> integer Send the list of file descriptors fds over an AF_UNIX socket. i)rr> SOL_SOCKET SCM_RIGHTSarray)rebuffersfdsflagsaddresss rsend_fdsr)s? ||Gw'9'9    C 5'7&89 9rrrecvmsgc tjd}|j|tj||jz\}}}}|D]d\}} } |tj k(s| tj k(s/|j| dt| t| |jzz f|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. rN) rrr>CMSG_LENitemsizerr frombytesrlist) rebufsizemaxfdsrrmsgancdatarj cmsg_level cmsg_type cmsg_datas rrecv_fdsr5skk#$(LL   Vcll2 3%5!WeT07 K ,J 9g000Y'BTBT5T i)II#i.3<<*GHJK K DIud**rrsharectddd|S)z fromshare(info) -> socket object Create a socket object from the bytes object returned by socket.share(pid). r)r6)infos r fromsharerIs aAt$$rr socketpairc| t}tj|||\}}t ||||j }t ||||j }||fS#t$r t}YgwxYw)aasocketpair([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. )AF_UNIX NameErrorr<r>rr6r)rArBrCarps rrrTsx > ! !!&$61 64 3 64 3!t  !  !sA A21A2c|tk(rt}n|tk(rt}n t d|t k7r t d|dk7r t dt |||} |j|df|j|jdd\}}t |||} |jd |j||f|jd|j\}} |j||fS#ttf$rYJwxYw#|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=r6bindlistenrRriconnectrInterruptedErrorrkrJ) rArBrChostlsockrjportcsockssock_s rrris< W D x  D-. . ; HI I A:>? ?vtU+  JJay ! LLN**,Ra0JD$64/E !!%(MM4,/!!$' <<>q KKMu~()9:   KKMsCAD.%D7D $DDDDDD++D..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. cleZdZdZdZdZdZdZdZfdZ dZ e d Z e d Z d ZxZS) ruzRaw 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. c|dvrtd|ztjj|||_d|vr|dz }||_d|v|_d|v|_d|_y)N)rqrrrwrbwbrwbzinvalid mode: %rrprqrrF) r&rv RawIOBaser?_sock_mode_reading_writing_timeout_occurred)r@rer}s rr?zSocketIO.__init__sj : :/$67 7 d# d? CKD t  t  !&rc|j|j|jr td |jj |S#t $r d|_t$r}|jtvrYd}~yd}~wwxYw)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 objectTN) _checkClosed_checkReadablerrr recv_intorrTerrno_blocking_errnosr@rpes rreadintozSocketIO.readintos    ! !=> > zz++A.. )-& 77.. sAB .BBB c|j|j |jj|S#t$r}|j t vrYd}~yd}~wwxYw)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. N)r_checkWritablerrrTrrrs rwritezSocketIO.writesW   ::??1% % ww**   s= A#AAA#cH|jr td|jS)z2True if the SocketIO is open for reading. I/O operation on closed socket.)rWr&rrGs rreadablezSocketIO.readable! ;;>? ?}}rcH|jr td|jS)z2True if the SocketIO is open for writing. r#)rWr&rrGs rwritablezSocketIO.writabler%rcN|jr tdt| S)z2True if the SocketIO is open for seeking. r#)rWr&rseekablers rr)zSocketIO.seekables& ;;>? ?w!!rcV|j|jjS)z=Return the file descriptor of the underlying socket. )rrrDrGs rrDzSocketIO.filenos# zz  ""rc<|js|jSy)Nr;)rWrDrGs rrz SocketIO.names{{;;= rc|jSrF)rrGs rr}z SocketIO.modes zzrc|jrytjj||jj d|_y)zClose the SocketIO object. This doesn't close the underlying socket, except if all references to it have disappeared. N)rWrvrrJrrrGs rrJzSocketIO.closes7 ;;  4  $$& r)r1r2r3rr?rr!r$r'r)rDrrr}rJrrs@rrurusX '. "#  rruc|j}|r|dvr t} t|\}}}|jd||D] }d|vs|S|}|S#t$rY|SwxYw)azGet 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, '0.0.0.0' or '::', hostname from gethostname() is returned. )z0.0.0.0z::r.)strip gethostname gethostbyaddrinsertrT)rhostnamealiasesipaddrss rr r s ::r6rr= setsockoptrGrHrT)res rrr]sj 7N37M2 Hk * d OOL+q 9    s.A/A#A/#A,(A/,A// A;:A;)rAbacklog reuse_portdualstack_ipv6cz|rttds td|r)ts td|tk7r tdt |t } tjdvr,ttdr |jttd|r|jttdtrb|tk(rY|r|jtt dn;ttd r+ttd r|jtt d |j#|||j)|S|j)||S#t$rYwxYw#t$r.}|j$d |d }t|j&|d d }~wwxYw#t$r|j+wxYw)aConvenience 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)rcygwin SO_REUSEADDRrsrrHrGz& (while attempting to bind on address )N)rr>r&rrr6r=rrrJrrQrTrOrIrGrHrstrerrorrrrJ)rrArKrLrMrerrs rrrms{&''>:FGG!#LM M X FG G &+ &D' 77* *0  L!<  OOJ a 8 (* k1=-0G^4 k1= 2 IIg  ? KKM  KK  -   2w(C 3'T 1 2   s["F=EBFE%/FF E"F!E""F% F.)FFFF:cg}tj||||||D]<}|\}} }} } |jt|tt| t || | f>|S)aResolve 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>r9r<r)rr) rrrArBrCraddrlistr@rArBrCrDs rr9r9sp H""4vtUEJ0-0*HeY+B >+HjA 2/ 00 Or)rr)rN)rrrr)2rr>rsysrvrenumrrr ImportErrorrPrrr __all__extend_get_exports_list _convert_r1rrr)platformlowerrr.r< Exceptionr0r6r rrrrrr=rr<rrrur objectr:r rrr9r4rrras.`! w" " %e]B/  @#r##G,-57 79 68 57   <<""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:) (DGW^^DGL , 7>>9%9 NN: 7>>9%+" NN: 7>>7#% NN; 7L![*" 1#H NN<  [*rr||rj6!('>%)099>09f  &-du!&BJm EsO00O;:O;