403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/twisted/internet/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyc
ó
B±Nc@sûdZeZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZmZd
„Zdefd„ƒYZd
efd„ƒYZeƒjejƒƒdS(s0
Tests for implementations of L{IReactorFDSet}.
iÿÿÿÿN(t
implements(tplatform(tSkipTest(t
IReactorFDSettIReadDescriptor(tFileDescriptor(tReactorBuilder(tEINPROGRESStEWOULDBLOCKcCsátjƒ}|jdƒ|jdƒz£tjƒ}y||jtƒy!|jd|jƒdfƒWn5tjk
r}|jdt	t
fkrž‚qžnX|jƒ\}}Wn|jƒ‚nXWd|jƒX||fS(Ns	127.0.0.1ii(s	127.0.0.1i(
tsockettbindtlistentsetblockingtFalsetconnecttgetsocknameterrortargsRRtaccepttclose(tserverSockettclienttetservertaddr((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt
socketpairs$


!

tReactorFDSetTestsBuildercBs¤eZdZegZd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zejƒr¢de_nRS(s>
    Builder defining tests relating to L{IReactorFDSet}.
    cCs9tƒ\}}|j|jƒ|j|jƒ||fS(sL
        Return the two sockets which make up a new TCP connection.
        (Rt
addCleanupR(tselfRR((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt_connectedPair6scCsC|jƒ}|jƒ\}}t|ƒ}|j|_|||fS(N(tbuildReactorRRtfileno(RtreactorRRtfd((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt_simpleSetup@s
cs[|jƒ\‰‰}‡‡fd†}|ˆ_ˆjˆƒ|jdƒ|jˆƒdS(s©
        C{reactor.addReader()} accepts an L{IReadDescriptor} provider and calls
        its C{doRead} method when there may be data available on its C{fileno}.
        csˆjˆƒˆjƒdS(N(tremoveReadertstop((R!R (sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt
removeAndStopRs
txN(R"tdoReadt	addReadertsendallt
runReactor(RRR%((R!R sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_addReaderKs	

csˆjƒ\}}}‡fd†}||_|j|ƒ|j|ƒ|jdƒ|jd|jd|jƒˆj|ƒdS(sÈ
        L{reactor.removeReader()} accepts an L{IReadDescriptor} provider
        previously passed to C{reactor.addReader()} and causes it to no longer
        be monitored for input events.
        csˆjdƒdS(NsdoRead should not be called(tfail((R(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR,fsR&iN(R"R'R(R#R)t	callLaterR$R*(RR R!RR,((RsD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_removeReader^s	


csN|jƒ\‰‰}‡‡fd†}|ˆ_ˆjˆƒ|jˆƒdS(s³
        C{reactor.addWriter()} accepts an L{IWriteDescriptor} provider and
        calls its C{doWrite} method when it may be possible to write to its
        C{fileno}.
        csˆjˆƒˆjƒdS(N(tremoveWriterR$((R!R (sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR%~s
N(R"tdoWritet	addWriterR*(RRR%((R!R sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_addWritervs
	
cCså|jƒ}t|d|dƒ}t|d|ƒ}t|d|ƒ}|jƒ\}}|j||ƒƒ|j||ƒƒ||ƒ|j||ƒƒ|j||ƒƒ||ƒ|j||ƒƒ|j||ƒƒdS(s=
        Helper for getReaders and getWriters tests.
        tgettstaddtremoveN(RtgetattrRtassertNotIntassertIn(RtkindR R3R5R6RR((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt
_getFDTestˆs

cCs|jdƒdS(s¡
        L{IReactorFDSet.getReaders} reflects the additions and removals made
        with L{IReactorFDSet.addReader} and L{IReactorFDSet.removeReader}.
        tReaderN(R;(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_getReadersŸscstˆjƒ\}}}‡fd†}||_|j|ƒ|j|ƒ|jd|jd|jƒˆj|ƒdS(sÊ
        L{reactor.removeWriter()} accepts an L{IWriteDescriptor} provider
        previously passed to C{reactor.addWriter()} and causes it to no longer
        be monitored for outputability.
        csˆjdƒdS(NsdoWrite should not be called(R,((R(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR,¯siN(R"R0R1R/R-R$R*(RR R!RR,((RsD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_removeWriter§s	

cCs|jdƒdS(s¡
        L{IReactorFDSet.getWriters} reflects the additions and removals made
        with L{IReactorFDSet.addWriter} and L{IReactorFDSet.removeWriter}.
        tWriterN(R;(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_getWriters¾scs¸ˆjƒ}ˆjƒ\}}}‡fd†|_‡fd†|_|jdƒ|j|ƒ|j|ƒ|jƒ}|jd|jd|j	ƒˆj
|ƒˆj||gƒdS(s¯
        C{reactor.removeAll()} removes all registered L{IReadDescriptor}
        providers and all registered L{IWriteDescriptor} providers and returns
        them.
        cs
ˆjdƒS(NsdoRead should not be called(R,((R(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt<lambda>Ðscs
ˆjdƒS(NsdoWrite should not be called(R,((R(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRAÑsR&iN(RR"R'R0R)R(R1t	removeAllR-R$R*tassertEqual(RR R!Rtremoved((RsD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_removeAllÆs



cCsL|jƒ}t|ƒ}|j|jƒ|j|ƒ|j|jgƒdS(s†
        A descriptor's C{fileno} method should not be called after the
        descriptor has been removed from the reactor.
        N(RtRemovingDescriptortcallWhenRunningtstartR*RCtcalls(RR t
descriptor((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_removedFromReactoräs

csŠ|jƒ‰|jƒ\‰‰dtf‡‡‡fd†ƒY}|ˆƒ}ˆj|ƒˆjdƒ|jˆƒ|j|jdƒdS(sp
        If L{FileDescriptor.fileno} returns C{-1}, the descriptor is removed
        from the reactor.
        tDisappearingDescriptorcsDeZˆjƒZdZd„Z‡‡fd†Z‡fd†ZRS(tcSs|jS(N(t_fileno(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRþscs2d|_|jˆjdƒ7_ˆjdƒdS(Niÿÿÿÿity(RNt	_receivedtrecvtsend(R(RR(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR's	csˆjƒdS(N(R$(Rtreason(R (sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pytconnectionLosts(t__name__t
__module__RRNRPR'RT((R RR(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRLùs
	R&N(RRRR(RRR*RCRP(RRLRJ((R RRsD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_negativeOneFileDescriptorðs"


cs¾ˆjƒ‰ˆjj}|d	kr:td|fƒ‚nˆjƒ\}‰dtf‡‡fd†ƒY}ˆj|ƒƒ‡‡fd†}ˆjd|ƒˆjˆƒˆj	t
jƒdS(
s
        The file descriptor underlying a FileDescriptor may be closed and
        replaced by another at some point.  Bytes which arrive on the new
        descriptor must not be delivered to the FileDescriptor which was
        originally registered with the original descriptor of the same number.

        Practically speaking, this is difficult or impossible to detect.  The
        implementation relies on C{fileno} raising an exception if the original
        descriptor has gone away.  If C{fileno} continues to return the original
        file descriptor value, the reactor may deliver events from that
        descriptor.  This is a best effort attempt to ease certain debugging
        situations.  Applications should not rely on it intentionally.
        tEPollReactort	CFReactors&%r cannot detect lost file descriptorstVictimcs5eZdZ‡fd†Zd„Z‡fd†ZRS(sŠ
            This L{FileDescriptor} will have its socket closed out from under it
            and another socket will take its place.  It will raise a
            socket.error from C{fileno} after this happens (because socket
            objects remember whether they have been closed), so as long as the
            reactor calls the C{fileno} method the problem will be detected.
            cs
ˆjƒS(N(R(R(R(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR2scSstdƒ‚dS(Ns$Victim.doRead should never be called(t	Exception(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR'5scsˆjƒdS(sÊ
                When the problem is detected, the reactor should disconnect this
                file descriptor.  When that happens, stop the reactor so the
                test ends.
                N(R$(RRS(R (sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRT8s(RURVt__doc__RR'RT((RR (sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRZ*s	csOˆjƒ\}}ˆjƒ}ˆjƒtj|jƒ|ƒ|jdƒdS(NR&(RRRtostdup2RR(tnewCtnewSR(RR(sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pytmessItUpGs

iN(RXRY(Rt	__class__RURRRR(R-R*tflushLoggedErrorsR	R(RtnameRRZRa((R RRsD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyttest_lostFileDescriptors
s*Cannot duplicate socket filenos on Windows(RURVR\RtrequiredInterfacesRR"R+R.R2R;R=R>R@RERKRWReRt	isWindowstskip(((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR0s"		
											 	DRFcBsNeZdZeeƒd„Zd„Zd„Zd„Zd„Z	d„Z
RS(s˜
    A read descriptor which removes itself from the reactor as soon as it
    gets a chance to do a read and keeps track of when its own C{fileno}
    method is called.

    @ivar insideReactor: A flag which is true as long as the reactor has
        this descriptor as a reader.

    @ivar calls: A list of the bottom of the call stack for any call to
        C{fileno} when C{insideReactor} is false.
    cCs4||_t|_g|_tƒ\|_|_dS(N(R R
t
insideReactorRIRtreadtwrite(RR ((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt__init__is			cCs-t|_|jj|ƒ|jjdƒdS(Nta(tTrueRiR R(RkRR(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRHps	cCsdS(Ntfoo((R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt	logPrefixvscCs*|jj|ƒt|_|jjƒdS(N(R R#R
RiR$(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR'zs	cCs9|js,|jjtjddƒd ƒn|jjƒS(Ntlimitiiÿÿÿÿ(RiRItappendt	tracebackt
extract_stackRjR(R((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyR€s	#cCsdS(N((RRS((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRT†s(RURVR\RRRlRHRpR'RRT(((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyRFZs
					(R\ttypet
__metaclass__R]R	Rstzope.interfaceRttwisted.python.runtimeRttwisted.trial.unittestRttwisted.internet.interfacesRRttwisted.internet.abstractRt#twisted.internet.test.reactormixinsRttwisted.internet.tcpRRRRtobjectRFtglobalstupdatetmakeTestCaseClasses(((sD/usr/lib/python2.7/dist-packages/twisted/internet/test/test_fdset.pyt<module>s$	ÿ+0

Youez - 2016 - github.com/yon3zu
LinuXploit