KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/usr/lib64/python2.4/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/usr/lib64/python2.4/asyncore.pyo
mò
‚=5Dc@s›dZdkZdkZdkZdkZdkZdkZdklZl	Z	l
Z
lZlZl
Z
lZlZlZyeWnej
o
hZnXdeifd„ƒYZd„Zd„Zd„Zd„Zd	dd
„Zd	dd„ZeZdeddd
„Zdfd„ƒYZdefd„ƒYZ d„Z!dd„Z"ei#djo6dk$Z$dfd„ƒYZ%defd„ƒYZ&ndS(s Basic 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(	sEALREADYsEINPROGRESSsEWOULDBLOCKs
ECONNRESETsENOTCONNs	ESHUTDOWNsEINTRsEISCONNs	errorcodetExitNowcBstZRS(N(t__name__t
__module__(((t /usr/lib64/python2.4/asyncore.pyR@scCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(tobjthandle_read_eventRthandle_error(R((RtreadCscCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(Rthandle_write_eventRR(R((RtwriteKscCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(Rthandle_expt_eventRR(R((Rt
_exceptionSscCsšym|titiB@o|iƒn|ti@o|iƒn|titi	Bti
B@o|iƒnWn&tj
o
‚n|i
ƒnXdS(N(tflagstselecttPOLLINtPOLLPRIRRtPOLLOUTRtPOLLERRtPOLLHUPtPOLLNVALR
RR(RR((Rt	readwrite[sf0.0c
Cs
|djo
t}n|oëg}g}g}x|iƒD]s\}}	|	i	ƒ}|	iƒ}|o|i
|ƒn|o|i
|ƒn|p|o|i
|ƒq=q=Wg|jo|jo
|jnoti|ƒn]y%ti||||ƒ\}}}Wn4tij
o%}|dtjo‚qKdSnXx;|D]3}|i|ƒ}	|	djoqRnt|	ƒqRWx;|D]3}|i|ƒ}	|	djoqnt|	ƒqWx?|D]3}|i|ƒ}	|	djoqÎnt|	ƒqÎWndS(Ni(tmaptNonet
socket_maptrtwtetitemstfdRtreadabletis_rtwritabletis_wtappendttimetsleepttimeoutR
terrorterrtEINTRtgetRR	R(
R$RRRR R&RRRR((RtpollhsP


*%	


cCs‚|djo
t}n|dj	ot|dƒ}ntiƒ}|o3x™|iƒD]‹\}}d}|iƒo|ti
tiBO}n|iƒo|tiO}n|o/|titiBtiBO}|i||ƒqXqXWy|i|ƒ}Wn6tij
o'}|dtjo‚ng}nXxH|D]<\}}|i|ƒ}|djoq:nt||ƒq:WndS(Nièi(RRRR$tintR
R)tpollsterRRRRRRRRRRRRtregisterRR%R&R'R(R(R$RRR&R+RRR((Rtpoll2“s8






f30.0cCs¢|djo
t}n|ottdƒo
t}nt}|djo xP|o|||ƒqNWn4x0|o(|djo|||ƒ|d}qnWdS(NR)ii(RRRtuse_pollthasattrR
R-tpoll_funR)tcountR$(R$R.RR1R0((Rtloopµs




t
dispatchercBs=tZeZeZeZeZdZddd„Z	d„Z
dd„Zdd„Zd„Z
dd„Zd„Zd„Zd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%RS(NcCs|djo
t|_n
||_|oY|i||ƒ|iidƒt	|_
y|iƒ|_WqŒti
j
oqŒXn
d|_dS(Ni(RRRtselft_maptsockt
set_sockettsockettsetblockingtTruet	connectedtgetpeernametaddrR%(R4R6R((Rt__init__Ïs

			cCsÒ|iid|iig}|io|io|idƒn|io|idƒn|idj	oHy|id|iƒWqµt
j
o|it|iƒƒqµXnddi|ƒt
|ƒfS(Nt.t	listeningR;s%s:%ds<%s at %#x>t (R4t	__class__RRtstatust	acceptingR=R!R;Rt	TypeErrortreprtjointid(R4RC((Rt__repr__äs
cCs+|djo
|i}n|||i<dS(N(RRR4R5t_fileno(R4R((Rtadd_channelñs

cCsK|i}|djo
|i}n|i|ƒo||=nd|_dS(N(R4RJRRRR5thas_key(R4RR((Rtdel_channel÷s	

cCsT||f|_ti||ƒ|_|iidƒ|iiƒ|_|iƒdS(Ni(	tfamilyttypeR4tfamily_and_typeR8R9tfilenoRJRK(R4RNRO((Rt
create_sockets
cCs)||_|iƒ|_|i|ƒdS(N(R6R4R8RQRJRKR(R4R6R((RR7s	cCsVy9|iititi|iititiƒdBƒWntij
onXdS(Ni(R4R8t
setsockoptt
SOL_SOCKETtSO_REUSEADDRt
getsockoptR%(R4((Rtset_reuse_addr
scCstS(N(R:(R4((RRscCstS(N(R:(R4((RR!scCs@t|_tidjo|djo
d}n|ii|ƒS(Ntntii(R:R4RDtostnametnumR8tlisten(R4R[((RR\(s	
cCs||_|ii|ƒS(N(R=R4R8tbind(R4R=((RR].s	cCs†t|_|ii|ƒ}|ttt	fjodSn|dt
fjo ||_t|_|i
ƒnti|t|f‚dS(Ni(tFalseR4R;R8t
connect_extaddressR&tEINPROGRESStEALREADYtEWOULDBLOCKtEISCONNR=R:thandle_connectR%t	errorcode(R4R`R&((Rtconnect2s			cCsZy#|iiƒ\}}||fSWn0tij
o!}|dtjoqV‚nXdS(Ni(R4R8taccepttconnR=R%twhyRc(R4RjRiR=((RRh?scCsYy|ii|ƒ}|SWn8tij
o)}|dtjodSn‚dSnXdS(Ni(R4R8tsendtdatatresultR%RjRc(R4RlRmRj((RRkJscCsy3|ii|ƒ}|p|iƒdSn|SWnGtij
o8}|dtt	t
gjo|iƒdSq}‚nXdS(Nti(R4R8trecvtbuffer_sizeRlthandle_closeR%Rjt
ECONNRESETtENOTCONNt	ESHUTDOWN(R4RpRlRj((RRoUs

cCs|iƒ|iiƒdS(N(R4RMR8tclose(R4((RRugs
cCst|i|ƒS(N(tgetattrR4R8tattr(R4Rw((Rt__getattr__mscCstiidt|ƒƒdS(Nslog: %s
(tsyststderrR	tstrtmessage(R4R|((RtlogtstinfocCs+tp
|djod||fGHndS(NR~s%s: %s(t	__debug__ROR|(R4R|RO((Rtlog_infowscCsh|io%|ip
t|_n|iƒn6|ip!|iƒt|_|iƒn|iƒdS(N(R4RDR;R:t
handle_acceptRethandle_read(R4((RR{s




	cCs/|ip|iƒt|_n|iƒdS(N(R4R;ReR:thandle_write(R4((RR‰s


cCs|iƒdS(N(R4thandle_expt(R4((RR
scCsmtƒ\}}}}yt|ƒ}Wndt|ƒ}nX|i	d||||fdƒ|i
ƒdS(Ns)<__repr__(self) failed for object at %0x>s:uncaptured python exception, closing channel %s (%s:%s %s)R%(tcompact_tracebacktniltttvttbinfoRFR4t	self_reprRHR€Ru(R4R‰R†RˆRŠR‡((RR“scCs|iddƒdS(Nsunhandled exceptiontwarning(R4R€(R4((RR„§scCs|iddƒdS(Nsunhandled read eventR‹(R4R€(R4((RR‚ªscCs|iddƒdS(Nsunhandled write eventR‹(R4R€(R4((RRƒ­scCs|iddƒdS(Nsunhandled connect eventR‹(R4R€(R4((RRe°scCs|iddƒdS(Nsunhandled accept eventR‹(R4R€(R4((RR³scCs|iddƒ|iƒdS(Nsunhandled close eventR‹(R4R€Ru(R4((RRq¶s(&RRR^tdebugR;RDtclosingRR=R>RIRKRMRRR7RWRRR\R]RgRhRkRoRuRxR}R€RRR
RR„R‚RƒReRRq(((RR3ÇsD	
								
															tdispatcher_with_sendcBs;tZddd„Zd„Zd„Zd„Zd„ZRS(NcCs ti|||ƒd|_dS(NRn(R3R>R4R6Rt
out_buffer(R4R6R((RR>ÁscCs3d}ti||id ƒ}|i||_dS(Nii(tnum_sentR3RkR4R(R4R((Rt
initiate_sendÅscCs|iƒdS(N(R4R‘(R4((RRƒÊscCs|ip
t|iƒS(N(R4R;tlenR(R4((RRÍscCsC|io|idt|ƒƒn|i||_|iƒdS(Ns
sending %s(R4RŒR€RFRlRR‘(R4Rl((RRkÐs
(RRRR>R‘RƒRRk(((RRŽ¿s
			c
CsÁtiƒ\}}}	g}xF|	o>|i|	iii	|	iii
t|	iƒfƒ|	i
}	qW~	|d\}}}dig}|D]}|d|q‹~ƒ}|||f|||fS(NiÿÿÿÿRAs
[%s|%s|%s](Rytexc_infoR‡RˆttbR‰R!ttb_frametf_codetco_filenametco_nameR{t	tb_linenottb_nexttfiletfunctiontlineRGt_[1]txR~(
R‰RœR›R~RžR‡RˆRŸRR”((RR…Ús1.cCsI|djo
t}nx!|iƒD]}|iiƒq$W|iƒdS(N(RRRtvaluesRŸR8Rutclear(RRŸ((Rt	close_allís


tposixtfile_wrappercBsAtZd„Zd„Zd„ZeZeZd„Zd„ZRS(NcCs
||_dS(N(RR4(R4R((RR>scGsti|i|ŒS(N(RYRR4Rtargs(R4R¥((RRoscGsti|i|ŒS(N(RYR	R4RR¥(R4R¥((RRkscCsti|iƒdS(N(RYRuR4R(R4((RRuscCs|iS(N(R4R(R4((RRQs(	RRR>RoRkRR	RuRQ(((RR¤s				tfile_dispatchercBstZdd„Zd„ZRS(NcCshti|d|ƒt|_|i|ƒt	i	|t	i
dƒ}|ti
B}t	i	|t	i|ƒdS(Ni(R3R>R4RRR:R;tset_fileRtfcntltF_GETFLRRYt
O_NONBLOCKtF_SETFL(R4RRR((RR>s	

cCs&||_t|ƒ|_|iƒdS(N(RR4RJR¤R8RK(R4R((RR§%s	(RRRR>R§(((RR¦s	('t__doc__t
exceptionsR
R8RyR"RYterrnoRbRaRcRrRsRtR'RdRfRt	NameErrort	ExceptionRRR	RRRR)R-tpoll3R^R2R3RŽR…R¢RZR¨R¤R¦( RR¤RŽRR…R)RRdRfRrRR-R±RaRcR
R¨RsR¢RRyR¦R'R3RtR8R	R"R­RbRYR2((Rt?/s8						=				
+ ø		

Anon7 - 2021