config root man

Current Path : /usr/local/lib/python2.5/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/python2.5/asyncore.pyc

³ò
h”Rc@s¤dZddkZddkZddkZddkZddkZddklZlZl	Z	l
Z
lZlZl
Z
lZlZyeWnej
o
hZnXdefd„ƒYZd„Zd„Zd„Zd	„Zd
dd„Zd
dd„ZeZd
eddd„Zddd„ƒYZdefd„ƒYZd„Z dd„Z!ei"djo9ddk#Z#ddd„ƒ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.
iÿÿÿÿN(	tEALREADYtEINPROGRESStEWOULDBLOCKt
ECONNRESETtENOTCONNt	ESHUTDOWNtEINTRtEISCONNt	errorcodetExitNowcBseZRS((t__name__t
__module__(((s$/usr/local/lib/python2.5/asyncore.pyR	?scCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(thandle_read_eventR	thandle_error(tobj((s$/usr/local/lib/python2.5/asyncore.pytreadBscCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(thandle_write_eventR	R
(R((s$/usr/local/lib/python2.5/asyncore.pytwriteJscCs;y|iƒWn&tj
o
‚n|iƒnXdS(N(thandle_expt_eventR	R
(R((s$/usr/local/lib/python2.5/asyncore.pyt
_exceptionRscCsšym|titiB@o|iƒn|ti@o|iƒn|titiBtiB@o|i	ƒnWn&t
j
o
‚n|iƒnXdS(N(tselecttPOLLINtPOLLPRIRtPOLLOUTRtPOLLERRtPOLLHUPtPOLLNVALRR	R
(Rtflags((s$/usr/local/lib/python2.5/asyncore.pyt	readwriteZsgc
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||||ƒ\}}}Wn4ti	j
o%}	|	dt
jo‚qKdSnXx;|D]3}|i|ƒ}|djoqRnt|ƒqRWx;|D]3}|i|ƒ}|djoqnt
|ƒqWx?|D]3}|i|ƒ}|djoqÎnt|ƒqÎWndS(Ni(tNonet
socket_maptitemstreadabletwritabletappendttimetsleepRterrorRtgetRRR(
ttimeouttmaptrtwtetfdRtis_rtis_wterr((s$/usr/local/lib/python2.5/asyncore.pytpollgsT


*%	


c	Cs‚|djo
t}n|dj	ot|dƒ}ntiƒ}|o3x™|iƒD]‹\}}d}|iƒo|titiBO}n|i	ƒo|ti
O}n|o/|titiBti
BO}|i||ƒqXqXWy|i|ƒ}Wn6tij
o'}|dtjo‚ng}nXxH|D]<\}}|i|ƒ}|djoq:nt||ƒq:WndS(Nièi(RRtintRR0RR RRR!RRRRtregisterR%RR&R(R'R(tpollsterR,RRR)R/((s$/usr/local/lib/python2.5/asyncore.pytpoll2’s8






g>@cCs¢|djo
t}n|ottdƒo
t}nt}|djo xP|o|||ƒqNWn4x0|o(|djo|||ƒ|d}qnWdS(NR0ii(RRthasattrRR4R0(R'tuse_pollR(tcounttpoll_fun((s$/usr/local/lib/python2.5/asyncore.pytloop´s




t
dispatchercBs=eZeZeZeZeZdZddd„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(cCs|djo
t|_n
||_|oY|i||ƒ|iidƒt|_y|iƒ|_	WqŒti
j
oqŒXn
d|_dS(Ni(RRt_mapt
set_sockettsockettsetblockingtTruet	connectedtgetpeernametaddrR%(tselftsockR(((s$/usr/local/lib/python2.5/asyncore.pyt__init__Îs

			cCsÒ|iid|iig}|io|io|idƒn|io|idƒn|idj	oHy|id|iƒWqµtj
o|it	|iƒƒqµXnddi
|ƒt|ƒfS(Nt.t	listeningR@s%s:%ds<%s at %#x>t (t	__class__RR
t	acceptingRBR"R@Rt	TypeErrortreprtjointid(RCtstatus((s$/usr/local/lib/python2.5/asyncore.pyt__repr__ãs
cCs+|djo
|i}n|||i<dS(N(RR;t_fileno(RCR(((s$/usr/local/lib/python2.5/asyncore.pytadd_channelðs

cCsK|i}|djo
|i}n|i|ƒo||=nd|_dS(N(RQRR;thas_key(RCR(R,((s$/usr/local/lib/python2.5/asyncore.pytdel_channelös	

cCsT||f|_ti||ƒ|_|iidƒ|iiƒ|_|iƒdS(Ni(tfamily_and_typeR=R>tfilenoRQRR(RCtfamilyttype((s$/usr/local/lib/python2.5/asyncore.pyt
create_socketÿs
cCs)||_|iƒ|_|i|ƒdS(N(R=RVRQRR(RCRDR(((s$/usr/local/lib/python2.5/asyncore.pyR<s	c	CsVy9|iititi|iititiƒdBƒWntij
onXdS(Ni(R=t
setsockoptt
SOL_SOCKETtSO_REUSEADDRt
getsockoptR%(RC((s$/usr/local/lib/python2.5/asyncore.pytset_reuse_addrs	cCstS(N(R?(RC((s$/usr/local/lib/python2.5/asyncore.pyR scCstS(N(R?(RC((s$/usr/local/lib/python2.5/asyncore.pyR! scCs@t|_tidjo|djo
d}n|ii|ƒS(Ntntii(R?RJtostnameR=tlisten(RCtnum((s$/usr/local/lib/python2.5/asyncore.pyRb's	
cCs||_|ii|ƒS(N(RBR=tbind(RCRB((s$/usr/local/lib/python2.5/asyncore.pyRd-s	cCs†t|_|ii|ƒ}|tttfjodSn|dtfjo ||_t	|_|i
ƒnti|t|f‚dS(Ni(
tFalseR@R=t
connect_exRRRRRBR?thandle_connectR%R(RCtaddressR/((s$/usr/local/lib/python2.5/asyncore.pytconnect1s			cCsZy#|iiƒ\}}||fSWn0tij
o!}|dtjoqV‚nXdS(Ni(R=tacceptR%R(RCtconnRBtwhy((s$/usr/local/lib/python2.5/asyncore.pyRj>scCsYy|ii|ƒ}|SWn8tij
o)}|dtjodSn‚dSnXdS(Ni(R=tsendR%R(RCtdatatresultRl((s$/usr/local/lib/python2.5/asyncore.pyRmIscCsy3|ii|ƒ}|p|iƒdSn|SWnGtij
o8}|dtttgjo|iƒdSq}‚nXdS(Nti(R=trecvthandle_closeR%RRR(RCtbuffer_sizeRnRl((s$/usr/local/lib/python2.5/asyncore.pyRqTs

cCs|iƒ|iiƒdS(N(RTR=tclose(RC((s$/usr/local/lib/python2.5/asyncore.pyRtfs
cCst|i|ƒS(N(tgetattrR=(RCtattr((s$/usr/local/lib/python2.5/asyncore.pyt__getattr__lscCstiidt|ƒƒdS(Nslog: %s
(tsyststderrRtstr(RCtmessage((s$/usr/local/lib/python2.5/asyncore.pytlogsstinfocCs+tp
|djod||fGHndS(NR}s%s: %s(t	__debug__(RCR{RX((s$/usr/local/lib/python2.5/asyncore.pytlog_infovscCsh|io%|ip
t|_n|iƒn6|ip!|iƒt|_|iƒn|iƒdS(N(RJR@R?t
handle_acceptRgthandle_read(RC((s$/usr/local/lib/python2.5/asyncore.pyRzs




	cCs/|ip|iƒt|_n|iƒdS(N(R@RgR?thandle_write(RC((s$/usr/local/lib/python2.5/asyncore.pyRˆs


cCs|iƒdS(N(thandle_expt(RC((s$/usr/local/lib/python2.5/asyncore.pyRsc	Csmtƒ\}}}}yt|ƒ}Wndt|ƒ}nX|id||||fdƒ|iƒdS(Ns)<__repr__(self) failed for object at %0x>s:uncaptured python exception, closing channel %s (%s:%s %s)R%(tcompact_tracebackRLRNRRt(RCtniltttvttbinfot	self_repr((s$/usr/local/lib/python2.5/asyncore.pyR
’scCs|iddƒdS(Nsunhandled exceptiontwarning(R(RC((s$/usr/local/lib/python2.5/asyncore.pyRƒ¦scCs|iddƒdS(Nsunhandled read eventRŠ(R(RC((s$/usr/local/lib/python2.5/asyncore.pyR©scCs|iddƒdS(Nsunhandled write eventRŠ(R(RC((s$/usr/local/lib/python2.5/asyncore.pyR‚¬scCs|iddƒdS(Nsunhandled connect eventRŠ(R(RC((s$/usr/local/lib/python2.5/asyncore.pyRg¯scCs|iddƒdS(Nsunhandled accept eventRŠ(R(RC((s$/usr/local/lib/python2.5/asyncore.pyR€²scCs|iddƒ|iƒdS(Nsunhandled close eventRŠ(RRt(RC((s$/usr/local/lib/python2.5/asyncore.pyRrµsN(&R
RRetdebugR@RJtclosingRRBRERPRRRTRYR<R^R R!RbRdRiRjRmRqRtRwR|RRRRR
RƒRR‚RgR€Rr(((s$/usr/local/lib/python2.5/asyncore.pyR:ÆsD	
								
															tdispatcher_with_sendcBs;eZddd„Zd„Zd„Zd„Zd„ZRS(cCs ti|||ƒd|_dS(NRp(R:REt
out_buffer(RCRDR(((s$/usr/local/lib/python2.5/asyncore.pyREÀscCs3d}ti||id ƒ}|i||_dS(Nii(R:RmRŽ(RCtnum_sent((s$/usr/local/lib/python2.5/asyncore.pyt
initiate_sendÄscCs|iƒdS(N(R(RC((s$/usr/local/lib/python2.5/asyncore.pyR‚ÉscCs|ip
t|iƒS(N(R@tlenRŽ(RC((s$/usr/local/lib/python2.5/asyncore.pyR!ÌscCsC|io|idt|ƒƒn|i||_|iƒdS(Ns
sending %s(R‹RRLRŽR(RCRn((s$/usr/local/lib/python2.5/asyncore.pyRmÏs
N(R
RRRERR‚R!Rm(((s$/usr/local/lib/python2.5/asyncore.pyR¾s
			c
CsÏtiƒ\}}}g}|pt‚xF|o>|i|iii|iiit|i	ƒfƒ|i
}q,W~|d\}}}dig}|D]}|d|q™~ƒ}	|||f|||	fS(NiÿÿÿÿRHs
[%s|%s|%s](Rxtexc_infotAssertionErrorR"ttb_frametf_codetco_filenametco_nameRzt	tb_linenottb_nextRM(
R†R‡ttbRˆtfiletfunctiontlinet_[1]txR}((s$/usr/local/lib/python2.5/asyncore.pyR„Ùs.cCsI|djo
t}nx!|iƒD]}|iiƒq$W|iƒdS(N(RRtvaluesR=Rttclear(R(RŸ((s$/usr/local/lib/python2.5/asyncore.pyt	close_allìs


tposixtfile_wrappercBsAeZd„Zd„Zd„ZeZeZd„Zd„ZRS(cCs
||_dS(N(R,(RCR,((s$/usr/local/lib/python2.5/asyncore.pyREscGsti|i|ŒS(N(R`RR,(RCtargs((s$/usr/local/lib/python2.5/asyncore.pyRq
scGsti|i|ŒS(N(R`RR,(RCR¥((s$/usr/local/lib/python2.5/asyncore.pyRm
scCsti|iƒdS(N(R`RtR,(RC((s$/usr/local/lib/python2.5/asyncore.pyRtscCs|iS(N(R,(RC((s$/usr/local/lib/python2.5/asyncore.pyRVs(	R
RRERqRmRRRtRV(((s$/usr/local/lib/python2.5/asyncore.pyR¤s				tfile_dispatchercBseZdd„Zd„ZRS(cCshti|d|ƒt|_|i|ƒti|tidƒ}|ti	B}ti|ti
|ƒdS(Ni(R:RERR?R@tset_filetfcntltF_GETFLR`t
O_NONBLOCKtF_SETFL(RCR,R(R((s$/usr/local/lib/python2.5/asyncore.pyREs	

cCs&||_t|ƒ|_|iƒdS(N(RQR¤R=RR(RCR,((s$/usr/local/lib/python2.5/asyncore.pyR§$s	N(R
RRRER§(((s$/usr/local/lib/python2.5/asyncore.pyR¦s	(((&t__doc__RR=RxR#R`terrnoRRRRRRRRRRt	NameErrort	ExceptionR	RRRRRR0R4tpoll3ReR9R:RR„R¢RaR¨R¤R¦(((s$/usr/local/lib/python2.5/asyncore.pys<module>/s6@				
+ ø	

Man Man