/usr/lib/python3.10/__pycache__
NameSizeModeActions
abc.cpython-310.pyc67510644editdlrm
aifc.cpython-310.pyc246850644editdlrm
antigravity.cpython-310.pyc8220644editdlrm
argparse.cpython-310.pyc635390644editdlrm
ast.cpython-310.pyc557390644editdlrm
asynchat.cpython-310.pyc70250644editdlrm
asyncore.cpython-310.pyc160020644editdlrm
base64.cpython-310.pyc171620644editdlrm
bdb.cpython-310.pyc258320644editdlrm
binhex.cpython-310.pyc128700644editdlrm
bisect.cpython-310.pyc25880644editdlrm
bz2.cpython-310.pyc108700644editdlrm
calendar.cpython-310.pyc263030644editdlrm
cgi.cpython-310.pyc267230644editdlrm
cgitb.cpython-310.pyc99980644editdlrm
chunk.cpython-310.pyc48600644editdlrm
cmd.cpython-310.pyc127070644editdlrm
code.cpython-310.pyc99570644editdlrm
codecs.cpython-310.pyc332190644editdlrm
codeop.cpython-310.pyc55950644editdlrm
colorsys.cpython-310.pyc32650644editdlrm
compileall.cpython-310.pyc127330644editdlrm
configparser.cpython-310.pyc454580644editdlrm
contextlib.cpython-310.pyc208950644editdlrm
contextvars.cpython-310.pyc2460644editdlrm
copy.cpython-310.pyc69960644editdlrm
copyreg.cpython-310.pyc46830644editdlrm
cProfile.cpython-310.pyc51130644editdlrm
crypt.cpython-310.pyc35500644editdlrm
csv.cpython-310.pyc117980644editdlrm
dataclasses.cpython-310.pyc265780644editdlrm
datetime.cpython-310.pyc565330644editdlrm
decimal.cpython-310.pyc3620644editdlrm
difflib.cpython-310.pyc589050644editdlrm
dis.cpython-310.pyc156560644editdlrm
doctest.cpython-310.pyc761750644editdlrm
enum.cpython-310.pyc260630644editdlrm
filecmp.cpython-310.pyc87490644editdlrm
fileinput.cpython-310.pyc140720644editdlrm
fnmatch.cpython-310.pyc42440644editdlrm
fractions.cpython-310.pyc186000644editdlrm
ftplib.cpython-310.pyc290340644editdlrm
functools.cpython-310.pyc283350644editdlrm
genericpath.cpython-310.pyc39070644editdlrm
getopt.cpython-310.pyc63390644editdlrm
getpass.cpython-310.pyc42100644editdlrm
gettext.cpython-310.pyc182210644editdlrm
glob.cpython-310.pyc58520644editdlrm
graphlib.cpython-310.pyc76160644editdlrm
gzip.cpython-310.pyc185460644editdlrm
hashlib.cpython-310.pyc68450644editdlrm
heapq.cpython-310.pyc138650644editdlrm
hmac.cpython-310.pyc69730644editdlrm
imaplib.cpython-310.pyc423120644editdlrm
imghdr.cpython-310.pyc39050644editdlrm
imp.cpython-310.pyc97860644editdlrm
inspect.cpython-310.pyc851530644editdlrm
io.cpython-310.pyc36630644editdlrm
ipaddress.cpython-310.pyc626700644editdlrm
keyword.cpython-310.pyc9270644editdlrm
linecache.cpython-310.pyc41420644editdlrm
locale.cpython-310.pyc461540644editdlrm
lzma.cpython-310.pyc121000644editdlrm
mailbox.cpython-310.pyc600910644editdlrm
mailcap.cpython-310.pyc73200644editdlrm
mimetypes.cpython-310.pyc176190644editdlrm
modulefinder.cpython-310.pyc161660644editdlrm
netrc.cpython-310.pyc39330644editdlrm
nntplib.cpython-310.pyc316230644editdlrm
ntpath.cpython-310.pyc147040644editdlrm
nturl2path.cpython-310.pyc17470644editdlrm
numbers.cpython-310.pyc118660644editdlrm
opcode.cpython-310.pyc54470644editdlrm
operator.cpython-310.pyc135080644editdlrm
optparse.cpython-310.pyc477540644editdlrm
os.cpython-310.pyc315990644editdlrm
pathlib.cpython-310.pyc420520644editdlrm
pdb.cpython-310.pyc474400644editdlrm
pickle.cpython-310.pyc468820644editdlrm
pickletools.cpython-310.pyc677600644editdlrm
pipes.cpython-310.pyc77690644editdlrm
pkgutil.cpython-310.pyc183610644editdlrm
platform.cpython-310.pyc274290644editdlrm
plistlib.cpython-310.pyc237650644editdlrm
poplib.cpython-310.pyc135730644editdlrm
posixpath.cpython-310.pyc105600644editdlrm
pprint.cpython-310.pyc178750644editdlrm
profile.cpython-310.pyc143910644editdlrm
pstats.cpython-310.pyc236210644editdlrm
pty.cpython-310.pyc41430644editdlrm
pyclbr.cpython-310.pyc97750644editdlrm
pydoc.cpython-310.pyc856450644editdlrm
py_compile.cpython-310.pyc73390644editdlrm
queue.cpython-310.pyc107920644editdlrm
quopri.cpython-310.pyc57940644editdlrm
random.cpython-310.pyc227480644editdlrm
re.cpython-310.pyc142270644editdlrm
reprlib.cpython-310.pyc52500644editdlrm
rlcompleter.cpython-310.pyc59540644editdlrm
runpy.cpython-310.pyc94110644editdlrm
sched.cpython-310.pyc61150644editdlrm
secrets.cpython-310.pyc21750644editdlrm
selectors.cpython-310.pyc171050644editdlrm
shelve.cpython-310.pyc94920644editdlrm
shlex.cpython-310.pyc77820644editdlrm
shutil.cpython-310.pyc385360644editdlrm
signal.cpython-310.pyc29350644editdlrm
site.cpython-310.pyc179220644editdlrm
sitecustomize.cpython-310.pyc2250644editdlrm
smtpd.cpython-310.pyc261470644editdlrm
smtplib.cpython-310.pyc357660644editdlrm
sndhdr.cpython-310.pyc69620644editdlrm
socket.cpython-310.pyc289630644editdlrm
socketserver.cpython-310.pyc253470644editdlrm
sre_compile.cpython-310.pyc151940644editdlrm
sre_constants.cpython-310.pyc63570644editdlrm
sre_parse.cpython-310.pyc217550644editdlrm
ssl.cpython-310.pyc452710644editdlrm
stat.cpython-310.pyc42730644editdlrm
statistics.cpython-310.pyc370510644editdlrm
string.cpython-310.pyc71020644editdlrm
stringprep.cpython-310.pyc170750644editdlrm
struct.cpython-310.pyc3070644editdlrm
subprocess.cpython-310.pyc447410644editdlrm
sunau.cpython-310.pyc164820644editdlrm
symtable.cpython-310.pyc128350644editdlrm
sysconfig.cpython-310.pyc181510644editdlrm
tabnanny.cpython-310.pyc69500644editdlrm
tarfile.cpython-310.pyc715780644editdlrm
telnetlib.cpython-310.pyc185060644editdlrm
tempfile.cpython-310.pyc273390644editdlrm
textwrap.cpython-310.pyc138120644editdlrm
this.cpython-310.pyc12640644editdlrm
threading.cpython-310.pyc449690644editdlrm
timeit.cpython-310.pyc117690644editdlrm
token.cpython-310.pyc27380644editdlrm
tokenize.cpython-310.pyc171940644editdlrm
trace.cpython-310.pyc198700644editdlrm
traceback.cpython-310.pyc217120644editdlrm
tracemalloc.cpython-310.pyc175250644editdlrm
tty.cpython-310.pyc10790644editdlrm
turtle.cpython-310.pyc1288570644editdlrm
types.cpython-310.pyc95250644editdlrm
typing.cpython-310.pyc852770644editdlrm
uu.cpython-310.pyc38670644editdlrm
uuid.cpython-310.pyc224980644editdlrm
warnings.cpython-310.pyc136460644editdlrm
wave.cpython-310.pyc175940644editdlrm
weakref.cpython-310.pyc203430644editdlrm
webbrowser.cpython-310.pyc174630644editdlrm
xdrlib.cpython-310.pyc78800644editdlrm
zipapp.cpython-310.pyc60130644editdlrm
zipfile.cpython-310.pyc618450644editdlrm
zipimport.cpython-310.pyc170330644editdlrm
_aix_support.cpython-310.pyc28790644editdlrm
_bootsubprocess.cpython-310.pyc22940644editdlrm
_collections_abc.cpython-310.pyc329250644editdlrm
_compat_pickle.cpython-310.pyc58720644editdlrm
_compression.cpython-310.pyc45120644editdlrm
_distutils_system_mod.cpython-310.pyc54220644editdlrm
_markupbase.cpython-310.pyc75720644editdlrm
_osx_support.cpython-310.pyc115350644editdlrm
_pydecimal.cpython-310.pyc1577360644editdlrm
_pyio.cpython-310.pyc736540644editdlrm
_py_abc.cpython-310.pyc46830644editdlrm
_sitebuiltins.cpython-310.pyc35470644editdlrm
_strptime.cpython-310.pyc159450644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-310.pyc353850644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-310.pyc353790644editdlrm
_threading_local.cpython-310.pyc65390644editdlrm
_weakrefset.cpython-310.pyc76080644editdlrm
__future__.cpython-310.pyc41310644editdlrm
__phello__.foo.cpython-310.pyc1300644editdlrm
Edit: /usr/lib/python3.10/__pycache__/asyncore.cpython-310.pyc (16002B)
o 9j,O@sxdZddlZddlZddlZddlZddlZddlZddlmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZejdeddee e eeeehZzeWn eyYiZYnwddZGd d d eZeeefZ d d Z!d dZ"ddZ#ddZ$d)ddZ%d)ddZ&e&Z'd*ddZ(GdddZ)Gddde)Z*d d!Z+d+d"d#Z,ej-d$krGd%d&d&Z.Gd'd(d(e)Z/dSdS),aBasic infrastructure for asynchronous socket service clients and servers. There are only two ways to have a program on a single processor do "more than one thing at a time". Multi-threaded programming is the simplest and most popular way to do it, but there is another very different technique, that lets you have nearly all the advantages of multi-threading, without actually using multiple threads. it's really only practical if your program is largely I/O bound. If your program is CPU bound, then pre-emptive scheduled threads are probably what you really need. Network servers are rarely CPU-bound, however. If your operating system supports the select() system call in its I/O library (and nearly all do), then you can use it to juggle multiple communication channels at once; doing other work while your I/O is taking place in the "background." Although this strategy can seem strange and complex, especially at first, it is in many ways easier to understand and control than multi-threaded programming. The module documented here solves many of the difficult problems for you, making the task of building sophisticated high-performance network servers and clients a snap. N) EALREADY EINPROGRESS EWOULDBLOCK ECONNRESETEINVALENOTCONN ESHUTDOWNEISCONNEBADF ECONNABORTEDEPIPEEAGAIN errorcodezlThe asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio) stacklevelc CsBzt|WStttfy |tvrt|YSd|YSw)NzUnknown error %s)osstrerror ValueError OverflowError NameErrorr)errr/usr/lib/python3.10/asyncore.py _strerrorKs   rc@s eZdZdS)ExitNowN)__name__ __module__ __qualname__rrrrrSsrcC2z|WdSty|YdSN)handle_read_event_reraised_exceptions handle_errorobjrrrreadX  r%cCrr)handle_write_eventr!r"r#rrrwrite`r&r(cCrr)handle_expt_eventr!r"r#rrr _exceptionhr&r*c Csz0|tj@r ||tj@r||tj@r||tjtjBtj B@r.| WdSWdSt yX}z|j t vrB|n | WYd}~dSWYd}~dSd}~wty_|YdSr)selectPOLLINr POLLOUTr'POLLPRIr)POLLHUPPOLLERRPOLLNVAL handle_closeOSErrorerrno _DISCONNECTEDr"r!)r$flagserrr readwriteps(      r8c Cs6|durt}|rg}g}g}t|D]&\}}|}|}|r'|||r1|js1|||s5|r:||qg|krJ|krJ|krSnnt|dSt ||||\}}}|D]}| |}|durlq`t |q`|D]}| |}|durqst |qs|D]}| |}|durqt |qdSdSr) socket_maplistitemsreadablewritableappend acceptingtimesleepr+getr%r(r*) timeoutmaprwr7fdr$is_ris_wrrrpollsF     "       rKcCs|durt}|durt|d}t}|r^t|D]&\}}d}|r.|tjtjBO}| r:|j s:|tj O}|rB| ||q||}|D]\}}| |}|durXqJt||qJdSdS)Nir)r:intr+rKr;r<r=r,r.r>r@r-registerrCr8)rDrEpollsterrHr$r6rFrrrpoll2s.        rO>@FcCs|durt}|rttdrt}nt}|dur#|r!||||sdSdS|r:|dkr>||||d}|r<|dks)dSdSdSdS)NrKr)r:hasattrr+rOrK)rDuse_pollrEcountpoll_funrrrloops   rVc@s2eZdZdZdZdZdZdZdZe dhZ dAddZ ddZ dBdd Z dBd d Zejejfd d ZdBddZddZddZddZddZddZddZddZddZd d!Zd"d#Zd$d%ZdCd'd(Zd)d*Z d+d,Z!d-d.Z"d/d0Z#d1d2Z$d3d4Z%d5d6Z&d7d8Z'd9d:Z(d;d<Z)d=d>Z*d?d@Z+dS)D dispatcherFNwarningc Cs|durt|_n||_d|_|rK|d|||d|_z||_WdStyJ}z|j t t fvr9d|_n| |WYd}~dSd}~wwd|_ dS)NFT)r:_map_fileno setblocking set_socket connected getpeernameaddrr3r4rr del_channelsocket)selfsockrErrrr__init__s&    zdispatcher.__init__cCs|jjd|jjg}|jr|jr|dn|jr|d|jdur@z |d|jWnty?|t|jYnwdd |t |fS)N. listeningr]z%s:%dz <%s at %#x> ) __class__rrr@r_r?r] TypeErrorreprjoinid)rbstatusrrr__repr__s     zdispatcher.__repr__cCs|dur|j}|||j<dSr)rYrZ)rbrErrr add_channelszdispatcher.add_channelcCs,|j}|dur |j}||vr||=d|_dSr)rZrY)rbrErHrrrr`s  zdispatcher.del_channelcCs.||f|_t||}|d||dSNF)family_and_typerar[r\)rbfamilytypercrrr create_sockets   zdispatcher.create_socketcCs||_||_||dSr)rafilenorZrorbrcrErrrr\%s zdispatcher.set_socketcCsBz|jtjtj|jtjtjdBWdSty YdSw)NrQ)ra setsockopt SOL_SOCKET SO_REUSEADDR getsockoptr3rbrrrset_reuse_addr*s  zdispatcher.set_reuse_addrcCdSNTrr{rrrr=;zdispatcher.readablecCr}r~rr{rrrr>>rzdispatcher.writablecCs(d|_tjdkr|dkrd}|j|S)NTnt)r@rnameralisten)rbnumrrrrEs zdispatcher.listencCs||_|j|Sr)r_rabind)rbr_rrrrKs zdispatcher.bindcCsnd|_d|_|j|}|tttfvs|tkr!tj dkr!||_ dS|dt fvr0||_ | dSt |t|)NFTrr)r] connectingra connect_exrrrrrrr_r handle_connect_eventr3r)rbaddressrrrrconnectOs   zdispatcher.connectc Csdz |j\}}W||fStyYdSty1}z|jtttfvr,WYd}~dSd}~wwr)raacceptrir3r4rr r )rbconnr_whyrrrr]s zdispatcher.acceptc Csfz |j|}|WSty2}z|jtkrWYd}~dS|jtvr-|WYd}~dSd}~wwNr)rasendr3r4rr5r2)rbdataresultrrrrrks   zdispatcher.sendc Cs`z|j|}|s|WdS|WSty/}z|jtvr*|WYd}~dSd}~wwN)rarecvr2r3r4r5)rb buffer_sizerrrrrrxs  zdispatcher.recvc Cspd|_d|_d|_||jdur6z|jWdSty5}z|jtt fvr*WYd}~dSd}~wwdSrp) r]r@rr`racloser3r4rr )rbrrrrrs zdispatcher.closecCstjdt|dS)Nzlog: %s )sysstderrr(str)rbmessagerrrlogszdispatcher.loginfocCs"||jvrtd||fdSdS)Nz%s: %s)ignore_log_typesprint)rbrrsrrrlog_infos zdispatcher.log_infocCs>|jr |dS|js|jr||dS|dSr)r@ handle_acceptr]rr handle_readr{rrrr s   zdispatcher.handle_read_eventcCs@|jtjtj}|dkrt|t||d|_d|_dS)NrTF) rarzrxSO_ERRORr3rhandle_connectr]rrbrrrrrs  zdispatcher.handle_connect_eventcCs*|jrdS|js|jr||dSr)r@r]rr handle_writer{rrrr's  zdispatcher.handle_write_eventcCs2|jtjtj}|dkr|dS|dSr)rarzrxrr2 handle_exptrrrrr)s  zdispatcher.handle_expt_eventcCsTt\}}}}zt|}Wn dt|}Y|d||||fd|dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)error)compact_tracebackrjrlrr2)rbniltvtbinfo self_reprrrrr"s  zdispatcher.handle_errorcC|dddS)Nz!unhandled incoming priority eventrXrr{rrrrzdispatcher.handle_exptcCr)Nzunhandled read eventrXrr{rrrrrzdispatcher.handle_readcCr)Nzunhandled write eventrXrr{rrrrrzdispatcher.handle_writecCr)Nzunhandled connect eventrXrr{rrrrrzdispatcher.handle_connectcCs"|}|dur|j|dSdSr)rhandle_accepted)rbpairrrrrszdispatcher.handle_acceptcCs||dddS)Nzunhandled accepted eventrX)rr)rbrcr_rrrrszdispatcher.handle_acceptedcCs|dd|dS)Nzunhandled close eventrX)rrr{rrrr2s  zdispatcher.handle_closeNNr)r),rrrdebugr]r@rclosingr_ frozensetrrdrnror`raAF_INET SOCK_STREAMrtr\r|r=r>rrrrrrrrrr rr'r)r"rrrrrrr2rrrrrWsL         rWc@s6eZdZd ddZddZddZdd Zd d ZdS) dispatcher_with_sendNcCst|||d|_dSr)rWrd out_bufferrvrrrrds zdispatcher_with_send.__init__cCs.d}t||jdd}|j|d|_dS)Nri)rWrr)rbnum_sentrrr initiate_sendsz"dispatcher_with_send.initiate_sendcCs |dSr)rr{rrrr s z!dispatcher_with_send.handle_writecCs|j pt|jSr)r]lenrr{rrrr>szdispatcher_with_send.writablecCs0|jr |dt||j||_|dS)Nz sending %s)rrrjrr)rbrrrrrs  zdispatcher_with_send.sendr)rrrrdrrr>rrrrrrs   rcCst\}}}g}|std|r'||jjj|jjjt|j f|j }|s~|d\}}}d dd|D}|||f|||fS)Nztraceback does not existrgcSsg|]}d|qS)z [%s|%s|%s]r).0xrrr -sz%compact_traceback..) rexc_infoAssertionErrorr?tb_framef_code co_filenameco_namer tb_linenotb_nextrk)rrtbrfilefunctionlinerrrrrs  rc Cs|durt}t|D]1}z|Wq ty/}z|jtkr"n|s%WYd}~q d}~wty6|s<Yq |dSr) r:r;valuesrr3r4r r!clear)rE ignore_allrrrr close_all0s$    rposixc@sNeZdZddZddZddZddZdd d ZeZeZ d d Z ddZ d S) file_wrappercCst||_dSr)rduprHrbrHrrrrdUrzfile_wrapper.__init__cCs*|jdkrtjd|t|d|dS)Nrzunclosed file %r)source)rHwarningswarnResourceWarningrr{rrr__del__Xs   zfile_wrapper.__del__cGtj|jg|RSr)rr%rHrbargsrrrr^zfile_wrapper.recvcGrr)rr(rHrrrrrarzfile_wrapper.sendNcCs$|tjkr|tjkr|sdStd)Nrz-Only asyncore specific behaviour implemented.)rarxrNotImplementedError)rbleveloptnamebuflenrrrrzds  zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t|dS)Nrr)rHrrrrrrros zfile_wrapper.closecCs|jSr)rHr{rrrruvszfile_wrapper.filenor) rrrrdrrrrzr%r(rrurrrrrPs  rc@seZdZdddZddZdS)file_dispatcherNcCsNt|d|d|_z|}Wn tyYnw||t|ddS)NTF)rWrdr]ruAttributeErrorset_filer set_blocking)rbrHrErrrrd{s   zfile_dispatcher.__init__cCs"t||_|j|_|dSr)rrarurZrorrrrrs   zfile_dispatcher.set_filer)rrrrdrrrrrrys  r)r9N)rPFNNrp)0__doc__r+rarrArrr4rrrrrrrr r r r r rrDeprecationWarningrr5r:rr ExceptionrKeyboardInterrupt SystemExitr!r%r(r*r8rKrOpoll3rVrWrrrrrrrrrrsT<     ' *  )