Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
WMc@sdZddkZddkZddkZddkZddkZddklZlZl Z l Z l Z l Z l Z lZlZlZlZyeWnej o hZnXdZdefdYZeeefZdZdZd Zd Zd ed Zd ed Z e Z!de"eedZ#dfdYZ$de$fdYZ%dZ&ee"dZ'ei(djo9ddk)Z)dfdYZ*de$fdYZ+ndS(sBasic 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. iN( tEALREADYt EINPROGRESSt EWOULDBLOCKt ECONNRESETtENOTCONNt ESHUTDOWNtEINTRtEISCONNtEBADFt ECONNABORTEDt errorcodecCsOyti|SWn7tttfj o"|tjo t|Sd|SXdS(NsUnknown error %s(toststrerrort ValueErrort OverflowErrort NameErrorR (terr((s/usr/lib/python2.6/asyncore.pyt _strerror?s   tExitNowcBseZRS((t__name__t __module__(((s/usr/lib/python2.6/asyncore.pyRGscCs;y|iWn&tj o n|inXdS(N(thandle_read_eventt_reraised_exceptionst handle_error(tobj((s/usr/lib/python2.6/asyncore.pytreadLs cCs;y|iWn&tj o n|inXdS(N(thandle_write_eventRR(R((s/usr/lib/python2.6/asyncore.pytwriteTs cCs;y|iWn&tj o n|inXdS(N(thandle_expt_eventRR(R((s/usr/lib/python2.6/asyncore.pyt _exception\s cCsy|ti@o|in|ti@o|in|ti@o|in|titiBti B@o|i nWnxt i j oD}|i dtttttfjo|iq|i n'tj o n|inXdS(Ni(tselecttPOLLINRtPOLLOUTRtPOLLPRIRtPOLLHUPtPOLLERRtPOLLNVALt handle_closetsocketterrortargsRRRRR RR(Rtflagste((s/usr/lib/python2.6/asyncore.pyt readwriteds$ gc Cs|djo t}n|og}g}g}x|iD]s\}}|i}|i}|o|i|n|o|i|n|p|o|i|q=q=Wg|jo|jo |jnoti|dSy%ti||||\}}}Wn7ti j o(} | i dt joqOdSnXx;|D]3}|i |}|djoqVnt |qVWx;|D]3}|i |}|djoqnt|qWx?|D]3}|i |}|djoqnt|qWndS(Ni(tNonet socket_maptitemstreadabletwritabletappendttimetsleepRR'R(RtgetRRR( ttimeouttmaptrtwR*tfdRtis_rtis_wR((s/usr/lib/python2.6/asyncore.pytpollysV     * %    c Cs|djo t}n|dj ot|d}nti}|o6x|iD]\}}d}|io|titiBO}n|i o|ti O}n|o/|ti ti Bti BO}|i||qXqXWy|i|}Wn9tij o*}|idtjong}nXxH|D]<\}}|i|}|djoq=nt||q=WndS(Nii(R,R-tintRR<R.R/RR!R0R R#R"R$tregisterR'R(RR4R+(R5R6tpollsterR9RR)R7R((s/usr/lib/python2.6/asyncore.pytpoll2s8          g>@cCs|djo t}n|ottdo t}nt}|djo xP|o|||qNWn4x0|o(|djo||||d}qnWdS(NR<ii(R,R-thasattrRR@R<(R5tuse_pollR6tcounttpoll_fun((s/usr/lib/python2.6/asyncore.pytloops     t dispatchercBsUeZeZeZeZeZd Ze dgZ d d dZ dZ d dZ d dZdZd dZdZdZd Zd Zd Zd Zd ZdZdZdZdZdZddZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(RS(!twarningcCs|djo t|_n ||_d|_|o|id|i||t|_y|i|_ Wqt i j o:}|i dt jo t|_q|i|qXn d|_ dS(Ni(R,R-t_mapt_filenot setblockingt set_sockettTruet connectedt getpeernametaddrR&R'R(RtFalset del_channel(tselftsockR6R((s/usr/lib/python2.6/asyncore.pyt__init__s          cCs|iid|iig}|io|io|idn|io|idn|idj oHy|id|iWqtj o|it |iqXnddi |t |fS(Nt.t listeningRMs%s:%ds <%s at %#x>t ( t __class__RRt acceptingROR1RMR,t TypeErrortreprtjointid(RRtstatus((s/usr/lib/python2.6/asyncore.pyt__repr__s cCs+|djo |i}n|||iscCs@t|_tidjo|djo d}n|ii|S(Ntnti(RLRYR tnameR&tlisten(RRtnum((s/usr/lib/python2.6/asyncore.pyRmEs  cCs||_|ii|S(N(ROR&tbind(RRRO((s/usr/lib/python2.6/asyncore.pyRoKs cCszt|_|ii|}|tttfjodS|dtfjo||_|i nti |t |dS(Ni( RPRMR&t connect_exRRRRROthandle_connect_eventR'R (RRtaddressR((s/usr/lib/python2.6/asyncore.pytconnectOs  cCs]y#|ii\}}||fSWn3tij o$}|idtjoqYnXdS(Ni(R&tacceptR'R(R(RRtconnROtwhy((s/usr/lib/python2.6/asyncore.pyRt[scCsy|ii|}|SWnctij oT}|idtjodS|idttttfjo|i dSnXdS(Ni( R&tsendR'R(RRRRR R%(RRtdatatresultRv((s/usr/lib/python2.6/asyncore.pyRwfs  cCsy0|ii|}|p|idS|SWnJtij o;}|idttttgjo|idSnXdS(Nti( R&trecvR%R'R(RRRR (RRt buffer_sizeRxRv((s/usr/lib/python2.6/asyncore.pyR{ss   cCsmt|_t|_|iy|iiWn9tij o*}|idtt fjoqinXdS(Ni( RPRMRYRQR&tcloseR'R(RR(RRRv((s/usr/lib/python2.6/asyncore.pyR}s   cCsJyt|i|SWn/tj o#td|ii|fnXdS(Ns!%s instance has no attribute '%s'(tgetattrR&tAttributeErrorRXR(RRtattr((s/usr/lib/python2.6/asyncore.pyt __getattr__s cCstiidt|dS(Nslog: %s (tsyststderrRtstr(RRtmessage((s/usr/lib/python2.6/asyncore.pytlogstinfocCs'||ijod||fGHndS(Ns%s: %s(tignore_log_types(RRRRc((s/usr/lib/python2.6/asyncore.pytlog_infoscCsH|io|in-|ip|i|in |idS(N(RYt handle_acceptRMRqt handle_read(RR((s/usr/lib/python2.6/asyncore.pyRs    cCs|it|_dS(N(thandle_connectRLRM(RR((s/usr/lib/python2.6/asyncore.pyRqs cCsy|iodS|ipR|iititi}|djoti|t|n|in|i dS(Ni( RYRMR&RiRgtSO_ERRORR'RRqt handle_write(RRR((s/usr/lib/python2.6/asyncore.pyRs   cCsD|iititi}|djo|in |idS(Ni(R&RiRgRR%t handle_expt(RRR((s/usr/lib/python2.6/asyncore.pyRs c Csmt\}}}}yt|}Wndt|}nX|id||||fd|idS(Ns)<__repr__(self) failed for object at %0x>s:uncaptured python exception, closing channel %s (%s:%s %s)R'(tcompact_tracebackR[R]RR%(RRtniltttvttbinfot self_repr((s/usr/lib/python2.6/asyncore.pyRscCs|idddS(Ns!unhandled incoming priority eventRG(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|idddS(Nsunhandled read eventRG(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|idddS(Nsunhandled write eventRG(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|idddS(Nsunhandled connect eventRG(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|idddS(Nsunhandled accept eventRG(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|idd|idS(Nsunhandled close eventRG(RR}(RR((s/usr/lib/python2.6/asyncore.pyR%sN()RRRPtdebugRMRYtclosingR,ROt frozensetRRTR_R`RQRdRKRjR/R0RmRoRsRtRwR{R}RRRRRqRRRRRRRRR%(((s/usr/lib/python2.6/asyncore.pyRFsH                    tdispatcher_with_sendcBs;eZdddZdZdZdZdZRS(cCs ti|||d|_dS(NRz(RFRTt out_buffer(RRRSR6((s/usr/lib/python2.6/asyncore.pyRTscCs3d}ti||id }|i||_dS(Nii(RFRwR(RRtnum_sent((s/usr/lib/python2.6/asyncore.pyt initiate_sendscCs|idS(N(R(RR((s/usr/lib/python2.6/asyncore.pyRscCs|i p t|iS(N(RMtlenR(RR((s/usr/lib/python2.6/asyncore.pyR0 scCsC|io|idt|n|i||_|idS(Ns sending %s(RRR[RR(RRRx((s/usr/lib/python2.6/asyncore.pyRw s N(RRR,RTRRR0Rw(((s/usr/lib/python2.6/asyncore.pyRs    c Csti\}}}g}|ptdnxF|o>|i|iii|iiit|i f|i }q5W~|d\}}}di g}|D]}|d|q~} |||f||| fS(Nstraceback does not existiRWs [%s|%s|%s]( Rtexc_infotAssertionErrorR1ttb_frametf_codet co_filenametco_nameRt tb_linenottb_nextR\( RRttbRtfiletfunctiontlinet_[1]txR((s/usr/lib/python2.6/asyncore.pyRs  .cCs|djo t}nx|iD]{}y|iWq$tj o/}|idtjoq|pqq$tj o q$|pqq$Xq$W|idS(Ni( R,R-tvaluesR}tOSErrorR(RRtclear(R6t ignore_allR((s/usr/lib/python2.6/asyncore.pyt close_all+s"    tposixt file_wrappercBsMeZdZdZdZddZeZeZdZ dZ RS(cCsti||_dS(N(R tdupR9(RRR9((s/usr/lib/python2.6/asyncore.pyRTRscGsti|i|S(N(R RR9(RRR(((s/usr/lib/python2.6/asyncore.pyR{UscGsti|i|S(N(R RR9(RRR(((s/usr/lib/python2.6/asyncore.pyRwXscCs=|tijo|tijo | odStddS(Nis-Only asyncore specific behaviour implemented.(R&RgRtNotImplementedError(RRtleveltoptnametbuflen((s/usr/lib/python2.6/asyncore.pyRi[s cCsti|idS(N(R R}R9(RR((s/usr/lib/python2.6/asyncore.pyR}fscCs|iS(N(R9(RR((s/usr/lib/python2.6/asyncore.pyReisN( RRRTR{RwR,RiRRR}Re(((s/usr/lib/python2.6/asyncore.pyRMs     tfile_dispatchercBseZddZdZRS(cCsti|d|t|_y|i}Wntj onX|i|ti|ti d}|t i B}ti|ti |dS(Ni( RFRTR,RLRMReRtset_filetfcntltF_GETFLR t O_NONBLOCKtF_SETFL(RRR9R6R)((s/usr/lib/python2.6/asyncore.pyRTns   cCs/t||_|ii|_|idS(N(RR&ReRIR`(RRR9((s/usr/lib/python2.6/asyncore.pyR{sN(RRR,RTR(((s/usr/lib/python2.6/asyncore.pyRls (,t__doc__RR&RR2R terrnoRRRRRRRRRR R R-RRt ExceptionRtKeyboardInterruptt SystemExitRRRRR+R,R<R@tpoll3RPRERFRRRRlRRR(((s/usr/lib/python2.6/asyncore.pyt/s<     L      , $