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/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyc
ó
ê=Nc@s*dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZddl
mZddlmZdd	lmZmZdd
lmZddlmZdd
„Zdejfd„ƒYZdejfd„ƒYZdefd„ƒYZdeejfd„ƒYZ deej!fd„ƒYZ"dej#fd„ƒYZ$d„Z%dej#fd„ƒYZ&dej'fd„ƒYZ(de"fd „ƒYZ)d!ej#fd"„ƒYZ*d#ej#fd$„ƒYZ+d%ej#fd&„ƒYZ,d'ej!fd(„ƒYZ-d)ej#fd*„ƒYZ.d+ejfd,„ƒYZ/d-ejfd.„ƒYZ0d/ej!fd0„ƒYZ1d1ej#fd2„ƒYZ2d3ejfd4„ƒYZ3d5ejfd6„ƒYZ4d7ejfd8„ƒYZ5d9e5fd:„ƒYZ6d;dbd<„ƒYZ7d=ej#e7fd>„ƒYZ8d?ej9fd@„ƒYZ:dAej;fdB„ƒYZ<dCej#fdD„ƒYZ=dEejfdF„ƒYZ>dGejfdH„ƒYZ?dIej!fdJ„ƒYZ@dKej9fdL„ƒYZAdMej;fdN„ƒYZBdOej#fdP„ƒYZCdQefdR„ƒYZDdSejfdT„ƒYZEdUej#fdV„ƒYZFdWej#fdX„ƒYZGdYej#fdZ„ƒYZHd[ej#fd\„ƒYZId]ej#fd^„ƒYZJd_ej#fd`„ƒYZKyddlLZLWneMk
rn$XeLjNeLjOƒddaZPePe8_QdS(cs.
Tests for implementations of L{IReactorTCP}.
iÿÿÿÿN(t
implements(tunittest(tmsg(tprotocoltreactortdefert
interfaces(terror(tIPv4Address(tIHalfCloseableProtocolt
IPullProducer(tpolicies(tAccumulatingProtocolics|ddlm}tjƒ‰‡‡fd†}|j|ƒ‰‡fd†}ˆj|ƒˆj|ƒ}|jˆjƒˆS(sš
    Poor excuse for an event notification helper.  This polls a condition and
    calls back a Deferred when it is seen to be true.

    Do not use this function.
    iÿÿÿÿ(ttaskcs#ˆƒ}|rˆj|ƒndS(N(tcallback(tres(t	predicatetd(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcheck s	csˆjƒ|S(N(tstop(tresult(tcall(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR%s
(	ttwisted.internetR
RtDeferredtLoopingCalltaddCallbacktstartt
addErrbackterrback(RtintervalR
RRtd2((RRRs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	loopUntils
tClosingProtocolcBseZd„Zd„ZRS(cCstdƒ|jjƒdS(NsClosingProtocol.connectionMade(Rt	transporttloseConnection(tself((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytconnectionMade1s
cCstdƒ|jtjƒdS(NsClosingProtocol.connectionLost(RttrapRtConnectionDone(R#treason((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytconnectionLost5s
(t__name__t
__module__R$R((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR /s	tClosingFactorycBs&eZdZdZd„Zd„ZRS(s/
    Factory that closes port immediately.
    cCs|jjƒ|_tƒS(N(tportt
stopListeningt
_cleanerUpperR (R#tconn((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt
buildProtocolBscCs#|jdkr|jjƒS|jS(sL
        Clean-up for tests to wait for the port to stop listening.
        N(R.tNoneR,R-(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcleanUpGs
N(R)R*t__doc__R1R.R0R2(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR+;s	tMyProtocolFactoryMixincBs>eZdZeZdZdZdZdZ	d„Z
d„ZRS(s
    Mixin for factories which create L{AccumulatingProtocol} instances.

    @type protocolFactory: no-argument callable
    @ivar protocolFactory: Factory for protocols - takes the place of the
        typical C{protocol} attribute of factories (but that name is used by
        this class for something else).

    @type protocolConnectionMade: L{NoneType} or L{defer.Deferred}
    @ivar protocolConnectionMade: When an instance of L{AccumulatingProtocol}
        is connected, if this is not C{None}, the L{Deferred} will be called
        back with the protocol instance and the attribute set to C{None}.

    @type protocolConnectionLost: L{NoneType} or L{defer.Deferred}
    @ivar protocolConnectionLost: When an instance of L{AccumulatingProtocol}
        is created, this will be set as its C{closedDeferred} attribute and
        then this attribute will be set to C{None} so the L{defer.Deferred} is
        not used by more than one protocol.

    @ivar protocol: The most recently created L{AccumulatingProtocol} instance
        which was returned from C{buildProtocol}.

    @type called: C{int}
    @ivar called: A counter which is incremented each time C{buildProtocol}
        is called.

    @ivar peerAddresses: A C{list} of the addresses passed to C{buildProtocol}.
    icCs
g|_dS(N(t
peerAddresses(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt__init__uscCsV|jj|ƒ|jd7_|jƒ}||_|j|_d|_||_|S(si
        Create a L{AccumulatingProtocol} and set it up to be able to perform
        callbacks.
        iN(	R5tappendtcalledtprotocolFactorytfactorytprotocolConnectionLosttclosedDeferredR1R(R#taddrtp((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0ys			N(R)R*R3RR9R1tprotocolConnectionMadeR;RR8R6R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR4Qs	tMyServerFactorycBseZdZRS(sI
    Server factory which creates L{AccumulatingProtocol} instances.
    (R)R*R3(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR@‰stMyClientFactorycBs>eZdZdZdZd„Zd„Zd„Zd„ZRS(sI
    Client factory which creates L{AccumulatingProtocol} instances.
    icCs/tj|ƒtjƒ|_tjƒ|_dS(N(R4R6RRtdeferredtfailDeferred(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6—s
cCs&d|_||_|jjdƒdS(Ni(tfailedR'RCRR1(R#t	connectorR'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytclientConnectionFailedœs		cCs||_|jjdƒdS(N(t
lostReasonRBRR1(R#RER'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytclientConnectionLost¡s	cCs
d|_dS(Ni(tstopped(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytstopFactory¥s(	R)R*R3RDRIR6RFRHRJ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRAs			tListeningTestCasecBsbeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
cCsNtƒ}tjd|ddƒ}|j|jƒ|jtjj|ƒƒdS(sf
        L{IReactorTCP.listenTCP} returns an object which provides
        L{IListeningPort}.
        it	interfaces	127.0.0.1N(	R@Rt	listenTCPt
addCleanupR-t
failUnlessRtIListeningPortt
providedBy(R#tftp1((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_listen¬s	csetƒ‰tjdˆddƒ}|jƒj‰‡‡fd†}tj|jƒ}|j|ƒ|S(s
        The L{IListeningPort} returned by L{IReactorTCP.listenTCP} can be
        stopped with its C{stopListening} method.  After the L{Deferred} it
        (optionally) returns has been called back, the port number can be bound
        to a new server.
        iRLs	127.0.0.1cs"tjˆˆddƒ}|jƒS(NRLs	127.0.0.1(RRMR-(tignoredR,(tnRR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcbStopListeningÂs(	R@RRMtgetHostR,Rt
maybeDeferredR-R(R#R,RWR((RRRVs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestStopListening·s	
cCs+tƒ}tjd|ddƒ}|jƒS(NiRLs	127.0.0.1(R@RRMR-(R#RRRS((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestNumberedInterfaceÌs	cs†tƒ}tjd|ƒ‰tˆjƒjƒ‰ˆjtˆƒjˆƒdkƒ‡‡‡fd†}t	j
ˆjƒ}|j|ƒS(Niiÿÿÿÿcs&ˆjtˆƒjˆƒdkƒdS(Niÿÿÿÿ(tfailIftreprtfind(tign(R#tportNoR>(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytstoppedListening×s(
R@RRMtstrRXR,R\R]R^RRYR-R(R#RRRaR((R`R#R>s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestPortReprÒs	"cs¶tƒ}tjƒ}|_tjd|ƒ‰ˆjˆjƒtƒ}tjƒ}|_tj	dˆj
ƒj|ƒ}ˆj|jƒ‡‡fd†}tj
||gƒj|ƒS(s
        Check that the repr string of the server transport get the good port
        number if the server listens on 0.
        is	127.0.0.1csY|\}}ˆjƒj}ˆjt|jƒd|fƒ|jjƒ|jjƒdS(Ns<AccumulatingProtocol #0 on %s>(RXR,tassertEqualR]R!R"(t.0tserverPrototclientProtot
portNumber(R#R,(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRìs	
(R@RRR?RRMRNR-RAt
connectTCPRXR,t
disconnectt
gatherResultsR(R#tservertserverConnMadetclienttclientConnMadeRER((R#R,s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_serverReprÝs			csutƒ‰tjdˆddƒ‰ˆjˆjƒ‡‡‡‡fd†}d„‰tjˆjƒ}|j|ƒ|S(sŽ
        Stop and then try to restart a L{tcp.Port}: after a restart, the
        server should be able to handle client connections.
        iRLs	127.0.0.1csˆjƒtƒ}tjƒˆ_tjƒ|_tjdˆjƒj|ƒ}ˆj	|j
ƒtjˆj|jgƒjˆƒS(Ns	127.0.0.1(
tstartListeningRARRR?RRiRXR,RNRjRkR(RURnRE(R#t
serverFactorytcloseR,(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRWs
		cSs*|\}}|jjƒ|jjƒdS(N(R!R"(ReRfRg((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRs
s	
(R@RRMRNR-RRYR(R#RWR((R#RrRsR,s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_restartListening÷s	
	
cCsItƒ}d„}||_tjd|ddƒ}|j|jƒtƒS(s»
        If the server factory raises an exception in C{stopFactory}, the
        deferred returned by L{tcp.Port.stopListening} should fail with the
        corresponding error.
        cSstdƒ‚dS(NsAn error(tRuntimeError(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytraiseExceptionsiRLs	127.0.0.1(R@RJRRMt
assertFailureR-Ru(R#RrRvR,((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_exceptInStops
			csƒtƒ‰d„}|ˆ_tjdˆddƒ‰ˆjˆjƒ‡‡‡‡fd†}d„‰ˆjˆjƒtƒj|ƒS(s¹
        Even if the server factory raise an exception in C{stopFactory}, the
        corresponding C{tcp.Port} instance should be in a sane state and can
        be restarted.
        cSstdƒ‚dS(NsAn error(Ru(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRv,siRLs	127.0.0.1cs‡ˆ`ˆjƒtƒ}tjƒˆ_tjƒ|_tjdˆjƒj	|ƒ}ˆj
|jƒtjˆj|jgƒj
ˆƒS(Ns	127.0.0.1(RJRqRARRR?RRiRXR,RNRjRkR(RURnRE(R#RrRsR,(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRW2s
		cSs*|\}}|jjƒ|jjƒdS(N(R!R"(ReRfRg((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRs@s	
(	R@RJRRMRNR-RwRuR(R#RvRW((R#RrRsR,s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_restartAfterExcept%s				cs–tƒ}tjd|ddƒ}|jƒj}|jdƒtƒ‰tj	ƒ|_
tj	ƒˆ_
tjd|ˆƒ‡fd†}ˆjj
|ƒS(së
        If C{connectionLost} is called directly on a port object, it succeeds
        (and doesn't expect the presence of a C{deferred} attribute).

        C{connectionLost} is called by L{reactor.disconnectAll} at shutdown.
        iRLs	127.0.0.1csˆjjtjƒdS(N(R'R%RtConnectionRefusedError(R_(Rn(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRXsN(R@RRMRXR,R(R1RARRR?RiRCR(R#RrR,RhR((Rns9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_directConnectionLostCallHs	
	cCsMtƒ}d„}||_tjd|ddƒ}|jt|jdƒdS(s
        If C{connectionLost} is called directory on a port object and that the
        server factory raises an exception in C{stopFactory}, the exception is
        passed through to the caller.

        C{connectionLost} is called by L{reactor.disconnectAll} at shutdown.
        cSstdƒ‚dS(NsAn error(Ru(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRvfsiRLs	127.0.0.1N(R@RJRRMtassertRaisesRuR(R1(R#RrRvR,((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_exceptInConnectionLostCall]s
			(R)R*RTRZR[RcRpRtRxRyR{R}(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRKªs								#	cCsIddlm}ddl}|j|ƒz|ƒWd|jdƒXdS(Niÿÿÿÿ(tspewerWithLinenums(ttwisted.python.utilR~tsystsettraceR1(RRtspewerR€((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcallWithSpewns
tLoopbackTestCasecBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
s$
    Test loopback connections.
    csŠtƒ}tjd|ddƒ‰ˆ|_ˆj|jƒˆjƒj}tƒ‰tjd|ˆƒ‡‡‡fd†}ˆj	j
|ƒS(sz
        A port created with L{IReactorTCP.listenTCP} can be connected to with
        L{IReactorTCP.connectTCP}.
        iRLs	127.0.0.1cs:ˆjˆjjƒˆjˆjƒˆjjtjƒdS(N(t
assertTrueRtmadetdisconnectedRGR%RR&(tx(R#R,tclientF(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‡s(R+RRMR,RNR2RXRARiRBR(R#RRRhR((R#R,R‰s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_closePortInProtocolFactory{s			cCs t|dd„ƒtjƒdS(NR%cSsdS(N(R1(Rˆ((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt<lambda>Žs(tgetattrRR&(R#tobj((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_trapCnxDonesc
s»tƒ}tjƒ}||_tjd|ddƒ}|j|jƒ|jƒj	}t
ƒ}tjƒ}||_tjd||ƒtj||gƒ}‡fd†}	|j
|	ƒ|S(s‰
        Invoke the given callback with a client protocol and a server protocol
        which have been connected to each other.
        iRLs	127.0.0.1cs7|\}}ˆ||ƒ|jjƒ|jjƒdS(N(R!R"(RetserverProtocoltclientProtocol(R(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	connected£s	

(R@RRR?RRMRNR-RXR,RARiRkR(
R#RRrRmR,RhR‰Rot	connsMadeR‘((Rs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_connectedClientAndServerTest‘s				
cs‡fd†}ˆj|ƒS(s
        The transport of a protocol connected with L{IReactorTCP.connectTCP} or
        L{IReactor.TCP.listenTCP} can have its I{TCP_NODELAY} state inspected
        and manipulated with L{ITCPTransport.getTcpNoDelay} and
        L{ITCPTransport.setTcpNoDelay}.
        cs€xy||gD]k}|j}ˆj|jƒdƒ|jdƒˆj|jƒdƒ|jdƒˆj|jƒdƒq
WdS(Nii(R!Rdt
getTcpNoDelayt
setTcpNoDelay(RRR>R!(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR²s	

(R“(R#R((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_tcpNoDelay«scs‡fd†}ˆj|ƒS(s
        The transport of a protocol connected with L{IReactorTCP.connectTCP} or
        L{IReactor.TCP.listenTCP} can have its I{SO_KEEPALIVE} state inspected
        and manipulated with L{ITCPTransport.getTcpKeepAlive} and
        L{ITCPTransport.setTcpKeepAlive}.
        cs€xy||gD]k}|j}ˆj|jƒdƒ|jdƒˆj|jƒdƒ|jdƒˆj|jƒdƒq
WdS(Nii(R!RdtgetTcpKeepAlivetsetTcpKeepAlive(RRR>R!(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÄs	

(R“(R#R((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_tcpKeepAliveœscsAtƒ‰tjddˆddƒ‡fd†}ˆjj|ƒS(Ns	127.0.0.1iEttimeouticsˆjjtjƒdS(N(R'R%RRz(RU(R‰(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÓs(RARRiRCR(R#R((R‰s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestFailingÏs	csâg‰xGtdƒD]9}tjƒ}|jdƒ|jdƒˆj|ƒqWtjˆƒtjt	tj
ƒ‰‡‡‡‡fd†‰ˆƒ}ˆj|tj
ƒ‡fd†}|j|ƒ‡fd†}|j|ƒ|S(	sŽ
        Assert that the error number of the ConnectionRefusedError is
        ECONNREFUSED, and not some other socket related error.
        i
s	127.0.0.1iics`‡‡‡fd†}ˆjƒ}|jƒ\}}|jƒˆj||ƒ}|j|ƒ|S(Ncs+|jjƒˆrˆƒSˆjdƒdS(s\
                Darn.  Kill it and try again, if there are any tries left.
                s?Could not fail to connect - could not test errno for that case.N(R!R"tfail(tproto(ttryConnectFailuret
serverSocketsR#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‘üs
(tpoptgetsocknameRsRiR(R‘tserverSockett
serverHostt
serverPorttconnectDeferred(RžRŸt
clientCreatorR#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRžûs	

csˆj|jtjƒdS(N(RdtosErrorterrnotECONNREFUSED(texc(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytconnRefusedscs!xˆrˆjƒjƒqW|S(N(R Rs(tpassthrough(RŸ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcleanups	(s	127.0.0.1i(txrangetsockettbindtlistenR7trandomtshuffleRt
ClientCreatorRtProtocolRwRRzRtaddBoth(R#tiR¢trefusedDeferredR«R­((RžRŸR#RŠs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt!test_connectionRefusedErrorNumberØs 


	

cCs&|jtjtjddtƒƒdS(su
        Connecting to a named service which does not exist raises
        L{error.ServiceNameUnknownError}.
        s	127.0.0.1tthisbetternotexistN(R|RtServiceNameUnknownErrorRRiRA(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_connectByServiceFailscsàtƒ‰tjƒ}|ˆ_tjdˆddƒ}ˆj|jƒ|jƒj	‰t
ƒ}tjƒ}||_‡fd†}ˆjtd|ƒtj
dd|ƒtj||gƒ}‡‡fd†}|j|ƒ|S(s×
        L{IReactorTCP.connectTCP} accepts the name of a service instead of a
        port number and connects to the port number associated with that
        service, as defined by L{socket.getservbyname}.
        iRLs	127.0.0.1cs |dkr|dkrˆSdS(Nthttpttcpi
((tserviceNametprotocolName(Rh(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytfakeGetServicePortByName5st
getservbynameRœcs=|\}}ˆjˆjdƒ|jjƒ|jjƒdS(Ns7Server factory was not called upon to build a protocol.(R…R8R!R"(ReRR(RrR#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‘>s	
(R@RRR?RRMRNR-RXR,RAtpatchR¯RiRkR(R#RmR,t
clientFactoryRoRÁtconnMadeR‘((R#RrRhs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_connectByService%s 				
(R)R*R3RŠRŽR“R–R™R›R¹RŒRÆ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR„ws								B	tStartStopFactorycBs&eZdZdZd„Zd„ZRS(icCs(|js|jrt‚nd|_dS(Ni(tstartedRIRu(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytstartFactoryMs	cCs)|js|jrt‚nd|_dS(Ni(RÈRIRu(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRJRs	(R)R*RÈRIRÉRJ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÇHs	tClientStartStopFactorycBs&eZdZdZd„Zd„ZRS(icCs(|js|jrt‚nd|_dS(Ni(RÈRIRu(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÉ]s	cCs)|js|jrt‚nd|_dS(Ni(RÈRIRu(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRJbs	(R)R*RÈRIRÉRJ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÊXs	tFactoryTestCasecBs eZdZd„Zd„ZRS(sTests for factories.cstƒ‰tjdˆddƒ}ˆj|jƒˆjˆjˆjfdƒtjdˆddƒ}tjdˆddƒ‰ˆjˆjˆjfdƒtj	|jƒ}tj	|jƒ}tj
||gƒ}‡‡‡fd†}|j|ƒ‡‡fd†}|j|ƒ|S(	s
        The factory passed to L{IReactorTCP.listenTCP} should be started only
        when it transitions from being used on no ports to being used on one
        port and should be stopped only when it transitions from being used on
        one port to being used on no ports.
        iRLs	127.0.0.1ics&ˆjˆjˆjfdƒˆjƒS(Nii(ii(RdRÈRIR-(RU(R#tp3RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcbClosedŠscs ˆjˆjˆjfdƒdS(Ni(ii(RdRÈRI(RU(R#RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcbClosedAlls(ii(ii(RÇRRMRNR-RdRÈRIRRYRkR(R#RStp2td1RR<RÍRÎ((RÌRRR#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_serverStartStopks
	

csˆtƒ}tjd|ddƒ}||_|j|jƒ|jƒj}tƒ‰tjd|ˆƒ|j	ˆj
ƒt‡fd†ƒS(s›
        The factory passed to L{IReactorTCP.connectTCP} should be started when
        the connection attempt starts and stopped when it is over.
        iRLs	127.0.0.1csˆjS(N(RI((R:(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹€s(R+RRMR,RNR2RXRÊRiR…RÈR(R#RRR>Rh((R:s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_clientStartStop–s			(R)R*R3RÑRÒ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRËhs	+tConnectorTestCasecBs#eZd„Zd„Zd„ZRS(cs0tƒ}tjd|ddƒ}||_ˆj|jƒ|jƒj}g‰g‰tƒ‰‡‡fd†ˆ_ˆj	ˆ_
tjd|ˆƒ‰ˆjt
jjˆƒƒˆjƒ}ˆj|jdƒˆj|jdƒˆj|j|ƒt‡fd†ƒ}‡‡‡‡fd†}|j|ƒ|S(sU
        L{IReactorTCP.connectTCP} returns an object which provides
        L{IConnector}.  The destination of the connector is the address which
        was passed to C{connectTCP}.  The same connector object is passed to
        the factory's C{startedConnecting} method as to the factory's
        C{clientConnectionLost} method.
        iRLs	127.0.0.1csˆj|ƒˆj|ƒfS(N(R7(RER'(tseenFailurestseenConnectors(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹œstTCPcsˆjS(N(RI((RÄ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹Èscs.ˆdjtjƒˆjˆˆˆgƒdS(Ni(R%RR&Rd(RU(RÕR#RERÔ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytclientFactoryStoppedÉs(R+RRMR,RNR2RXRÊRHR7tstartedConnectingRiR…Rt
IConnectorRQtgetDestinationRdttypethostRR(R#RrttcpPortRhtdestRR×((RÔRÕR#RERÄs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_connectorIdentityªs(			
cs¢tƒ}tjd|ddƒ}ˆj|jƒ|jƒj}d„}tƒ‰|ˆ_tj	d|ˆƒt
‡fd†ƒ}‡‡fd†}|j|ƒS(sÇ
        Calling L{IConnector.stopConnecting} in C{Factory.startedConnecting}
        results in C{Factory.clientConnectionFailed} being called with
        L{error.UserError} as the reason.
        iRLs	127.0.0.1cSs|jƒdS(N(tstopConnecting(RE((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRØÛscsˆjS(N(RI((RÄ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹âscs*ˆjˆjdƒˆjjtjƒdS(Ni(RdRDR'R%Rt	UserError(RU(R#RÄ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRãs(R@RRMRNR-RXR,RÊRØRiRR(R#RrRÝRhRØRR((R#RÄs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt
test_userFailÐs				cs«tƒ}tjd|ddƒ}||_ˆj|jƒ|jƒj}tƒ‰d„}|ˆ_tj	d|ˆƒt
‡fd†ƒ}‡‡fd†}|j|ƒS(s†
        Calling L{IConnector.connect} in C{Factory.clientConnectionLost} causes
        a new connection attempt to be made.
        iRLs	127.0.0.1cSs|jƒdS(N(tconnect(RER'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRHöscsˆjS(N(RD((RÄ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹ûscsOˆj}ˆj|j|jfdƒˆjjtjƒˆjˆjdƒdS(Ni(ii(	RRdR†tclosedR'R%RRzRI(RUR>(R#RÄ(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytreconnectFailedüs	(R+RRMR,RNR2RXRARHRiRR(R#RrRÝRhRHRRå((R#RÄs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_reconnectés					(R)R*RßRâRæ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÓšs	&	tCannotBindTestCasecBs)eZdZd„Zd„Zd„ZRS(s]
    Tests for correct behavior when a reactor cannot bind to the required TCP
    port.
    cCs«tƒ}tjd|ddƒ}|j|jƒ|jƒj}|jƒ}|j|jdƒ|j|j	dƒ|j|j|ƒ|j
tjtj||ddƒdS(sƒ
        L{IReactorTCP.listenTCP} raises L{error.CannotListenError} if the
        address to listen on is already in use.
        iRLs	127.0.0.1RÖN(
R@RRMRNR-RXR,RdRÛRÜR|RtCannotListenError(R#RRRSRVRÞ((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_cannotBinds	cs2ddlm}‡‡fd†}|jˆ|ƒS(sGReturns closure that when called calls f and then callbacks d.
        iÿÿÿÿ(tutilcs ˆ||Ž}ˆjdƒ|S(Nt(R(targstkwtrtn(RRR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytnewf$s
(ttwisted.pythonRêtmergeFunctionMetadata(R#RRRttputilRï((RRRs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_fireWhenDoneFunc scsçtjƒ}tƒ}ˆj||jƒ|_tjd|ddƒ‰ˆjˆjƒ‡‡‡fd†}‡‡fd†‰‡‡‡‡‡fd†‰‡fd†‰‡fd†‰‡‡fd	†‰‡fd
†‰|j	|ƒ|S(s³
        L{IReactorTCP.connectTCP} calls C{Factory.clientConnectionFailed} with
        L{error.ConnectBindError} if the bind address specified is already in
        use.
        iRLs	127.0.0.1csctjƒ}tƒ}ˆj||jƒ|_tjdˆjƒj|ddƒ|j	ˆ|ƒ|S(Ns	127.0.0.1tbindAddressi(s	127.0.0.1i(
RRRARóR0RRiRXR,R(tresultsRtcf1(R#R>t_conmade(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	_connect17s	cs>tjƒ}ˆj||jjƒ|j_|jˆ|ƒ|S(N(RRRóRR$R(RõRöR(R#t_check1connect2(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR÷@s
csöˆj|jjdƒtjƒ}tjƒ}|jjjƒj}tƒ}ˆj	||j
ƒ|_
ˆj	||jƒ|_tj
dˆjƒj|dd|fƒ|jˆ||ƒ|jˆ||ƒtj||gƒ}|jˆ||ƒ|S(Nis	127.0.0.1Rô(RdRR†RRR!RXR,RARóRFRJRRiRtDeferredList(RõRöRÐRR,tcf2tdl(t_check2stoppedt_stopR#t
_check2failedR>(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRùGs	
csFˆj|jdƒ|jjtjƒˆj|jjtjƒƒ|S(Ni(RdRDR'R%RtConnectBindErrorR…R(RõRöRû(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÿYscsˆj|jdƒ|S(Ni(RdRI(RõRöRû(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRý_scsHtjƒ}|jˆ|ƒˆj||jƒ|_|jjjƒ|S(N(RRRRóRJRR!R"(RõRöRûR(R#t_check1cleanup(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRþcs
csˆj|jdƒdS(Ni(RdRI(RõRö(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRjs(
RRR@RóRÉRRMRNR-R(R#ttheDeferredtsfRø((RýRþR#RÿR>R÷RRùs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_clientBind+s		
(R)R*R3RéRóR(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRçs		tMyOtherClientFactorycBseZd„ZRS(cCs||_tƒ|_|jS(N(taddressRR(R#R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0ss	(R)R*R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRrstLocalRemoteAddressTestCasecBseZdZd„ZRS(so
    Tests for correct getHost/getPeer values and that the correct address is
    passed to buildProtocol.
    csÎtƒ}tjƒ|_|j‰tjd|ddƒ‰ˆjˆjƒˆjƒj	}t
ƒ‰tjƒ}ˆ_tjd|ˆƒ‰‡‡‡fd†}|j
|ƒ‡‡fd†}|j
|ƒ|S(s
        L{IListeningPort.getHost} returns the same address as a client
        connection's L{ITCPTransport.getPeer}.
        iRLs	127.0.0.1csBˆjˆjƒgˆjƒˆjˆjƒˆjjjƒƒdS(N(RdRXR5RR!tgetPeer(RU(R#RÄR,(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRscsˆjƒˆS(N(Rj(RU(REtserverConnectionLost(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR­•s
(R@RRR;RRMRNR-RXR,RAR?RiR(R#RrRVtonConnectionRR­((R	R#RÄR,REs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_hostAddresss			

(R)R*R3R(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRzstWriterProtocolcBseZd„ZRS(cCs»|jjdƒddddg}|jj|ƒ|jjƒ}|jdkrhdG|GHd|j_n|jjƒ}|jdkržd	G|GHd|j_nd|j_|jj	ƒdS(
NsHello Cleveland!
tGoodbyes cruels worlds
RÖs getPeer returned non-TCP socket:is getHost returned non-TCP socket:(
R!twritet
writeSequenceRRÛR:tproblemRXtdoneR"(R#tseqtpeertus((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$¢s		(R)R*R$(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR¡stReaderProtocolcBseZd„Zd„ZRS(cCs|jj|7_dS(N(R:tdata(R#R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytdataReceivedžscCsd|j_dS(Ni(R:R(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(ºs(R)R*RR((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR·s	tWriterClientFactorycBseZd„Zd„ZRS(cCsd|_d|_dS(NiRë(RR(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6Ÿs	cCstƒ}||_||_|S(N(RR:R(R#R=R>((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0Ás			(R)R*R6R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRœs	tWriteDataTestCasecBs eZdZd„Zd„ZRS(sw
    Test that connected TCP sockets can actually write data. Try to exercise
    the entire ITransport interface.
    csÏtjƒ‰tˆ_dˆ_dˆ_tˆƒ}tjd|ddƒ}ˆj|j	ƒ|j
ƒj}tƒ‰tˆƒ}tj
d||ƒ‡‡‡fd†}tj|j|jgƒ}|j|ƒS(s‚
        L{ITCPTransport.write} and L{ITCPTransport.writeSequence} send bytes to
        the other end of the connection.
        iRLs	127.0.0.1cszˆjˆjdƒˆjˆjdkdƒˆjˆjdƒdjdddd	d
gƒ}ˆjˆj|kdƒdS(Ns&writer didn't finish, it probably diediswriter indicated an errors$client didn't see connection droppedRësHello Cleveland!
R
s cruels worlds
s.client didn't receive all the data it expected(RORRtjoinR(RUtexpected(R#R‰RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÞs	(RtFactoryRRRtWiredFactoryRRMRNR-RXR,RRiRRktonDisconnectR(R#twrappedFR>RVtwrappedClientFRR((RRR#R‰s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_writerÍs					cstjjdkr$tjdƒ‚ntjjdkrHtjdƒ‚ntjƒ‰tjƒ‰dtjf‡‡fd†ƒY}tj	ƒ}||_tj
d|dd	ƒ}|j|jƒ|j
ƒ}d
tfd„ƒY‰dtjf‡‡‡fd
†ƒY}tƒ‰|ˆ_ˆj}‡fd†}|j|ƒtd|j|jfƒtj|j|jˆƒtdƒ|j|tjƒS(s$
        A TCP transport which is written to after the connection has been shut
        down should notify its protocol that the connection has been lost, even
        if the TCP transport is not actively being monitored for read events
        (ie, pauseProducing was called on it).
        tIOCPReactors'iocpreactor does not, in fact, stop reading immediately after pauseProducing is called. This results in a bonus disconnection notification. Under some circumstances, it might be possible to not receive this notifications (specifically, pauseProducing, deliver some data, proceed with this test).t
GtkReactorsŸgtkreactor does not implement unclean disconnection notification correctly.  This might more properly be a todo, but due to technical limitations it cannot be.tDisconnectercs,eZdZ‡fd†Z‡fd†ZRS(sØ
            Protocol for the server side of the connection which disconnects
            itself in a callback on clientPaused and publishes notification
            when its connection is actually lost.
            cs*tdƒ‡fd†}ˆj|ƒdS(s[
                Set up a callback on clientPaused to lose the connection.
                sDisconnector.connectionMadecs%tdƒˆjjƒtdƒdS(Ns&Disconnector.connectionMade disconnectsloseConnection called(RR!R"(RU(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRj"s

N(RR(R#Rj(tclientPaused(R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$s
cs%tdƒˆjdƒtdƒdS(st
                Notify observers that the server side of the connection has
                ended.
                sDisconnecter.connectionLostsserverLost called backN(RRR1(R#R'(t
serverLost(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR((s

(R)R*R3R$R(((R%R&(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$siRLs	127.0.0.1tInfinitecBs3eZdZeeƒd„Zd„Zd„ZRS(s¿
            A producer which will write to its consumer as long as
            resumeProducing is called.

            @ivar consumer: The L{IConsumer} which will be written to.
            cSs
||_dS(N(tconsumer(R#R(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6AscSs(tdƒ|jjdƒtdƒdS(NsInfinite.resumeProducingRˆs*Infinite.resumeProducing wrote to consumer(RR(R(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytresumeProducingDs
cSstdƒdS(NsInfinite.stopProducing(R(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt
stopProducingIs(R)R*R3RR
R6R)R*(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR'8s

		tUnreadingWritercs#eZdZ‡‡‡fd†ZRS(s
            Trivial protocol which pauses its transport immediately and then
            writes some bytes to it.
            csQtdƒˆjjƒˆjdƒtdƒ‡‡fd†}ˆj|ƒdS(NsUnreadingWriter.connectionMadesclientPaused called backcsDtdƒˆˆjƒ}tdƒˆjj|tƒtdƒdS(Ns$UnreadingWriter.connectionMade writes5UnreadingWriter.connectionMade write created producers8UnreadingWriter.connectionMade write registered producer(RR!tregisterProducertFalse(RUtproducer(R#R'(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRWs


(RR!tpauseProducingRR1R(R#R(R%R'R&(R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$Rs



(R)R*R3R$((R'R%R&(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR+MscstdƒˆjS(NtcbClientLost(RRG(RU(Rn(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0ns
sConnecting to %s:%ssReturning Deferred(Rt	__class__R)RtSkipTestRRRRµt
ServerFactoryRMRNR-RXtobjectRAR9RBRRRÜR,RiRwRtConnectionLost(R#R$RlR,R=R+RHR0((R%RnR'R&s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt%test_writeAfterShutdownWithoutReadingìs2	"	%			

(R)R*R3R!R6(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÇs	tConnectionLosingProtocolcBseZd„ZRS(cCsD|jjdƒ|jjƒ|jjƒ|jjj|jƒdS(Nt1(R!RR"tmastert_connectionMadetportsR7(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$}s

(R)R*R$(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR7|stNoopProtocolcBseZd„Zd„ZRS(cCs)tjƒ|_|jjj|jƒdS(N(RRRR9tserverConnsR7(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$†scCs|jjtƒdS(N(RRtTrue(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(Šs(R)R*R$R((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR<…s	tConnectionLostNotifyingProtocolcBs eZdZd„Zd„ZRS(sc
    Protocol which fires a Deferred which was previously passed to
    its initializer when the connection is lost.

    @ivar onConnectionLost: The L{Deferred} which will be fired in
        C{connectionLost}.

    @ivar lostConnectionReason: C{None} until the connection is lost, then a
        reference to the reason passed to C{connectionLost}.
    cCsd|_||_dS(N(R1tlostConnectionReasontonConnectionLost(R#RA((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6šs	cCs||_|jj|ƒdS(N(R@RAR(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(Ÿs	(R)R*R3R6R((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR?s
	tHandleSavingProtocolcBseZdZd„ZRS(s•
    Protocol which grabs the platform-specific socket handle and
    saves it as an attribute on itself when the connection is
    established.
    cCs"|jƒ|_tjj||ƒS(s\
        Save the platform-specific socket handle for future
        introspection.
        (t	getHandlethandleRRµtmakeConnection(R#R!((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRE«s(R)R*R3RE(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRB¥stProperlyCloseFilesMixincBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sA
    Tests for platform resources properly being cleaned up.
    cCs
tƒ‚dS(sÂ
        Bind a server port to which connections will be made.  The server
        should use the given protocol factory.

        @return: The L{IListeningPort} for the server created.
        N(tNotImplementedError(R#RRhR:((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcreateServer¹scCs
tƒ‚dS(sÃ
        Establish a connection to the given address using the given
        L{ClientCreator} instance.

        @return: A Deferred which will fire with the connected protocol instance.
        N(RG(R#RRhRŠ((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt
connectClientÃscCs
tƒ‚dS(s…
        Return the exception class which will be raised when an operation is
        attempted on a closed platform handle.
        N(RG(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytgetHandleExceptionTypeÍscCstjS(sn
        Return the errno expected to result from writing to a closed
        platform socket handle.
        (RštEBADF(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytgetHandleErrorCodeÕs	csètjƒ‰tjƒ}‡fd†|_ˆjdd|ƒ‰tjƒ‰ˆjƒ}tjt‡fd†ƒ}ˆj|j	|j
|ƒ}‡‡fd†}|j|ƒ‡fd†}|j|ƒ‡fd†}|j|ƒ|S(sp
        Test that lost connections properly have their underlying socket
        resources cleaned up.
        cs
tˆƒS(N(R?((tonServerConnectionLost(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹èss	127.0.0.1ics
tˆƒS(N(RB((tonClientConnectionLost(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹ïscs0|jjdƒ|jjƒtjˆˆgƒS(sŠ
            Disconnect the client.  Return a Deferred which fires when both
            the client and the server have received disconnect notification.
            s0some bytes to make sure the connection is set up(R!RR"RRk(Rn(RNRM(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytclientConnectedós
	
csz|\}}|jjtjƒ|jjtjƒˆjƒ}ˆjˆjƒ|jjdƒ}ˆj	|j
d|ƒdS(sl
            Verify that the underlying platform socket handle has been
            cleaned up.
            tbytesiN(R@R%RtConnectionClosedRLR|RJRDtsendRdRì(ReRnRltexpectedErrorCodeterr(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytclientDisconnectedÿs	cs,tjˆjƒ}|j‡fd†ƒ|S(sx
            Shut down the server port.  Return a Deferred which fires when
            this has completed.
            csˆS(N((R_(R¬(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹s(RRYR-R(R¬R(R€(R¬s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR­s(
RRRR3RHRXRŽRRIRÜR,RR¶(R#Rrt
serverAddrRŠtclientDeferredRORUR­((RNR#RMR€s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_properlyCloseFilesás"



(R)R*R3RHRIRJRLRX(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRFµs	
	
		tProperlyCloseFilesTestCasecBs)eZdZd„Zd„Zd„ZRS(s
    Test that the sockets created by L{IReactorTCP.connectTCP} are cleaned up
    when the connection they are associated with is closed.
    cCstj||d|ƒS(sE
        Create a TCP server using L{IReactorTCP.listenTCP}.
        RL(RRM(R#RRhR:((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRHscCs|j||ƒS(sF
        Create a TCP client using L{IReactorTCP.connectTCP}.
        (Ri(R#RRhRŠ((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRI&scCstjS(s¬
        Return L{socket.error} as the expected error type which will be
        raised by a write to the low-level socket object after it has been
        closed.
        (R¯R(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRJ-s(R)R*R3RHRIRJ(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRYs		tWiredForDeferredscBs#eZd„Zd„Zd„ZRS(cCstjj|||ƒdS(N(RtProtocolWrapperR6(R#R:twrappedProtocol((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR68scCs'tjj|ƒ|jjjdƒdS(N(RR[R$R:t	onConnectRR1(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$;scCs*tjj||ƒ|jjjdƒdS(N(RR[R(R:RRR1(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(?s(R)R*R6R$R((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRZ7s		RcBseZeZd„ZRS(cCs5tjj||ƒtjƒ|_tjƒ|_dS(N(RtWrappingFactoryR6RRR]R(R#twrappedFactory((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6Hs(R)R*RZRR6(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyREstAddressTestCasecBs)eZdZd„Zd„Zd„ZRS(sR
    Tests for address-related interactions with client and server protocols.
    cCs#dtjfd„ƒY}tƒ|_tjƒ|_|j_tjƒ|_|j_	||jƒ|_
tƒ|_tjƒ|_
|j_tjƒ|_|j_	||jƒ|_tjd|j
ddƒ|_tj|jjƒj|jjƒj|jƒ|_tj|j|j
gƒS(s9
        Create a port and connected client/server pair which can be used
        to test factory behavior related to addresses.

        @return: A L{defer.Deferred} which will be called back when both the
            client and server protocols have received their connection made
            callback.
        tRememberingWrappercBs eZdZd„Zd„ZRS(s„
            Simple wrapper factory which records the addresses which are
            passed to its L{buildProtocol} method and delegates actual
            protocol creation to another factory.

            @ivar addresses: A list of the objects passed to buildProtocol.
            @ivar factory: The wrapped factory to which protocol creation is
                delegated.
            cSsg|_||_dS(N(t	addressesR:(R#R:((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6fs	cSs |jj|ƒ|jj|ƒS(sˆ
                Append the given address to C{self.addresses} and forward
                the call to C{self.factory}.
                (RbR7R:R0(R#R=((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0ms(R)R*R3R6R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRa\s		iRLs	127.0.0.1(Rt
ClientFactoryR@RlRRRmR?tserverConnLostR;t
serverWrapperRARnRotclientConnLostt
clientWrapperRRMR,RiRXRÜRERk(R#Ra((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytsetUpSs	-cCs8|jjƒtj|j|jtj|jjƒgƒS(sf
        Disconnect the client/server pair and shutdown the port created in
        L{setUp}.
        (	RERjRRkRdRfRYR,R-(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttearDownŒs
cCs„|jjjjƒ}|jjjjƒ}|j|jjt	d|j
|jƒgƒ|j|jjt	d|j
|jƒgƒdS(se
        L{ClientFactory.buildProtocol} should be invoked with the address of
        the server to which a connection has been established, which should
        be the same as the address reported by the C{getHost} method of the
        transport of the server protocol and as the C{getPeer} method of the
        transport of the client protocol.
        RÖN(RlRR!RXRnRRdRgRbRRÜR,(R#R£t
clientPeer((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_buildProtocolClient—s		(R)R*R3RhRiRk(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR`Os	9	tLargeBufferWriterProtocolcBseZd„ZRS(cCs7|jjd|jjƒd|j_|jjƒdS(NtXi(R!RR:tlenRR"(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR$°s(R)R*R$(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRl«stLargeBufferReaderProtocolcBseZd„Zd„ZRS(cCs|jjt|ƒ7_dS(N(R:Rn(R#R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR·scCsd|j_dS(Ni(R:R(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(¹s(R)R*RR((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRo¶s	tLargeBufferReaderClientFactorycBseZd„Zd„ZRS(cCsd|_d|_dS(Ni(RRn(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6œs	cCstƒ}||_||_|S(N(RoR:R(R#R=R>((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0Às			(R)R*R6R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRpŒs	tFireOnClosecBseZdZd„ZRS(saA wrapper around a protocol that makes it fire a deferred when
    connectionLost is called.
    cCs*tjj||ƒ|jjjdƒdS(N(RR[R(R:RBRR1(R#R'((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR(Ës(R)R*R3R((((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRqÇstFireOnCloseFactorycBseZeZd„ZRS(cCs&tjj||ƒtjƒ|_dS(N(RR^R6RRRB(R#R_((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6Ós(R)R*RqRR6(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRrÐstLargeBufferTestCasecBseZdZdZd„ZRS(s5Test that buffering large amounts of data works.
    i<icsÛtjƒ‰tˆ_dˆ_dˆ_ˆjˆ_tˆƒ}tj	d|ddƒ}ˆj
|jƒ|jƒj
}tƒ‰tˆƒ}tjd||ƒtj|j|jgƒ}‡‡‡fd†}|j|ƒS(NiRLs	127.0.0.1csVˆjˆjdƒˆjˆjˆjkdˆjˆjfƒˆjˆjdƒdS(Ns&writer didn't finish, it probably dieds9client didn't receive all the data it expected (%d != %d)s$client didn't see connection dropped(RORRntdatalen(RU(R#R‰RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRìs(RRRlRRRtRnRrRRMRNR-RXR,RpRiRRkRBR(R#RR>RVR RR((R#RRR‰s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt
testWriterÝs				iðiÀ(R)R*R3RtRu(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRsØstMyHCProtocolcBs0eZeeƒeZeZd„Zd„ZRS(cCs&t|_|jr"|jdƒndS(N(R>treadHalfClosedtwriteHalfClosedR(R1(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytreadConnectionLostýs		cCs&t|_|jr"|jdƒndS(N(R>RxRwR(R1(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytwriteConnectionLosts		(	R)R*RR	R-RwRxRyRz(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRvös

	tMyHCFactorycBseZdZdZd„ZRS(icCs.|jd7_tƒ}||_||_|S(Ni(R8RvR:R(R#R=R>((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR0s
			N(R)R*R8R1R?R0(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR{
stHalfCloseTestCasecBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sTest half-closing connections.cs–tƒˆ_}tjd|ddƒˆ_‰ˆjˆjƒt‡fd†ƒ}tj	tt
ƒˆ_|j‡‡fd†ƒ|jˆj
ƒ|S(NiRLs	127.0.0.1csˆjS(N(R‘((R>(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹scs%ˆjjˆjƒjˆjƒjƒS(N(tcfRiRXRÜR,(t_(R>R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹"s(R{RRRRMR>RNR-RRRŽRvR}Rt_setUp(R#RRR((R#R>s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRhscsN|ˆ_tjƒˆ_ˆj_ˆjˆjjjdƒt‡fd†ƒS(Nicstˆjddƒdk	S(NR(RŒRRR1((R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹,s(	RnRRtclientProtoConnectionLostR<RdR!R‘R(R#Rn((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR's	cseˆjˆjjdƒˆjjjƒtjˆjjƒ}|j	‡fd†ƒ|j	ˆj
ƒ|S(NicsˆjS(N(R€(R_(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹2s(RdRnRäR!R"RRYR>R-Rt	_tearDown(R#R((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRi.scs‰ˆjˆjjdƒˆjˆjjjdƒtjƒ‰‡‡fd†}|ˆjj_ˆjjjj	ƒˆj
‡fd†ƒˆS(Niics dˆjj_ˆjdƒdS(Ni(RRRRäRR1(R'(R#R(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_connectionLost<scsˆjˆjjjdƒS(Ni(RdRRRRä(Rˆ(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹As(RdRnRäRRRRRR(R!R"R(R#RUR‚((R#Rs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR6scs•ˆj‰ˆj‰ˆj‰ˆjdƒt‡fd†ƒ}‡fd†}‡‡‡fd†}‡‡‡fd†}|j|ƒj|ƒj|ƒS(NthellocstˆjƒdkS(Ni(Rnt_tempDataBuffer((tt(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹Jscsˆjƒt‡fd†ƒS(NcsˆjS(N(t_writeDisconnected((R…(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹Ms(tloseWriteConnectionR(RU(R…(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	loseWriteKs
csLˆjˆjtƒˆjˆjtƒˆjˆjtƒt‡fd†ƒS(Ncs
ˆjjS(N(RRw((RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹Rs(RdRäR-RxR>RwR(RU(RRR#Rn(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRNscs‚ˆjj}|dƒ|dƒˆjdtˆjjƒƒˆjˆjjdƒˆjˆjjtƒˆjˆjj	t
ƒdS(Ns worldslalala fooled youiRƒ(R!RRdRnR„RRRäR-RwR>(RUtw(RRR#Rn(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRSs

(RnRRR!RRR(R#RRˆRR((RRR#RnR…s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestCloseWriteCloserDs			
csiˆj‰ˆjjjƒtjt‡fd†ƒt‡fd†ƒgƒ}|j‡‡fd†ƒ|S(Ncs
ˆjjS(N(RRx((RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹bscs
ˆjjS(N(RnRw((R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹cscsˆjˆjjtƒS(N(RdRRwR-(R~(R#RR(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹ds(RRRR!R‡RRkRR(R#R((R#RRs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestWriteCloseNotification]s	(	R)R*R3RhRRiRRŠR‹(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR|s	
				tHalfClose2TestCasecBs5eZd„Zd„Zd„Zd„Zd„ZRS(cCs…tƒ|_}tjƒ|j_tjd|ddƒ|_}tj	tt
ƒj|jƒj
|jƒjƒ}|j|jƒ|S(NiRLs	127.0.0.1(R@RRRRR?RRMR>RRŽRRiRXRÜR,Rt
_gotClient(R#RRR>R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRhkscCs||_|jjS(N(RnRRR?(R#Rn((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRvs	cCs|jjjƒ|jjƒS(N(RnR!R"R>R-(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRi}scs‘ˆjjjdƒˆjjjƒtjƒˆjj_}tjƒˆj_}|j	‡fd†ƒ|j	‡fd†ƒtj
||gƒS(só
        TCP protocols support half-close connections, but not all of them
        support being notified of write closes.  In this case, test that
        half-closing the connection causes the peer's connection to be
        closed.
        RƒcsˆjˆjjjdƒS(NRƒ(RdRRRR(Rˆ(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹ŒscsˆjˆjjjtƒS(N(RdRRRRäR>(Rˆ(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹Žs(RnR!RR‡RRRRRR<RRk(R#RR((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestNoNotificationscsŽˆjjjjƒˆjjjdƒˆjjjƒtjƒˆjj_	}tjƒˆj_	}|j
‡fd†ƒtj||gƒS(sx
        If the other side has already closed its connection,
        loseWriteConnection should pass silently.
        RmcsˆjˆjjjtƒS(N(RdRRRRäR>(Rˆ(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹›s(RRRR!R"RnRR‡RRR<RRk(R#RR((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttestShutdownException‘s(R)R*RhRRiRŽR(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRŒis
				tHalfCloseBuggyApplicationTestscBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(sI
    Test half-closing connections where notification code has bugs.
    csœtƒˆ_tjƒˆj_tjdˆjddƒˆ_ˆjˆjj	ƒˆjj
ƒ}tjtt
ƒ}|j|j|jƒ}‡fd†}|j|ƒtjˆjj|gƒS(s|
        Set up a server and connect a client to it.  Return a Deferred which
        only fires once this is done.
        iRLs	127.0.0.1cs
|ˆ_dS(N(R(R(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	setClient²s(R{RrRRR?RRMR,RNR-RXRRŽRvRiRÜRRk(R#R=tcreatorRWR‘((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRh¥s
	cGstdƒ‚dS(s`
        Fake implementation of a callback which illegally raises an
        exception.
        sONO I AM BUGGY CODEN(Ru(R#Rì((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytaBugºscsFtjƒ}ˆj_ˆjjjƒ‡fd†}|j|ƒ|S(s~
        Helper for testing that an exception is logged by the time the
        client protocol loses its connection.
        cs)ˆjtƒ}ˆjt|ƒdƒdS(Ni(tflushLoggedErrorsRuRdRn(RUterrors(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRÉs(RRRR<R!R‡R(R#RäR((R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_notificationRaisesTestÂs

cCs|j|jj_|jƒS(sã
        If C{readConnectionLost} raises an exception when the transport
        calls it to notify the protocol of that event, the exception should
        be logged and the protocol should be disconnected completely.
        (R“RrRRyR–(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_readNotificationRaisesÐscCs|j|j_|jƒS(sä
        If C{writeConnectionLost} raises an exception when the transport
        calls it to notify the protocol of that event, the exception should
        be logged and the protocol should be disconnected completely.
        (R“RRzR–(R#((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_writeNotificationRaisesÚs(R)R*R3RhR“R–R—R˜(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR s				
tLogTestCasecBseZdZd„ZRS(s4
    Test logging facility of TCP base classes.
    cs¿tƒ}tƒ}tjƒ|_tjd|ddƒ}ˆj|jƒtj	|j
ƒj|j
ƒj|ƒ‰ˆjˆj
ƒˆjˆjjdƒ‡‡fd†}|jj|ƒ|jS(sx
        Check that the log customization of the client transport happens
        once the client is connected.
        iRLs	127.0.0.1t
UninitializedcsˆjˆjjdƒdS(NsAccumulatingProtocol,client(RdR!tlogstr(R_(RER#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcbÿs(R@RARRR?RRMRNR-RiRXRÜR,RjRdR!R›R(R#RlRnR,Rœ((R#REs9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_logstrClientSetupês		!(R)R*R3R(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR™åstPauseProducingTestCasecBs5eZdZd„Zejjeƒs3de_nRS(sG
    Test some behaviors of pausing the production of a transport.
    csžtƒ}tƒ}tjƒ|_tjd|ddƒ}ˆj|jƒtj	|j
ƒj|j
ƒj|ƒ}ˆj|j
ƒ‡‡fd†}‡fd†‰|jj|ƒ|jS(s˜
        In C{connectionMade} of a client protocol, C{pauseProducing} used to be
        ignored: this test is here to ensure it's not ignored.
        iRLs	127.0.0.1cs‰|j}ˆj|tjƒtjƒƒ|jjƒˆj|tjƒtjƒƒtjƒ}|j	ˆƒtj
d|j|ƒ|S(Ni(R!tassertInRt
getReaderst
getWritersR/tassertNotInRRRt	callLaterR(RttrR(R#tcheckAfterConnectionMade(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pytcheckInConnectionMades	

cs-|j}ˆj|tjƒtjƒƒdS(N(R!R¢RR R¡(RR€(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR¥)s	(R@RARRR?RRMRNR-RiRXRÜR,RjR(R#RlRnR,RERŠ((R¥R#s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt#test_pauseProducingInConnectionMades		!s#Reactor not providing IReactorFDSet(	R)R*R3R§Rt
IReactorFDSetRQRtskip(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRžs	%tCallBackOrderTestCasecBseZdZd„ZRS(s-
    Test the order of reactor callbacks
    c	s*tƒ}tjƒj‡fd†ƒ|_tƒ‰tjƒˆ_tjƒˆ_‡fd†}ˆjj|ƒtjd|ddƒ}ˆj	|j
ƒtj|jƒj
|jƒjˆƒ}ˆj	|jƒd„}d„}‡fd†}tjˆjj|ƒˆjj|ƒgƒ}|j|ƒS(	sl
        Check that Protocol.connectionLost is called before factory's
        clientConnectionLost
        csˆj|jjƒS(N(RNR!R"(R(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyR‹BscstjdˆjjjƒdS(s:
            protocol.connectionMade callback
            iN(RR£RR!R"(R(Rn(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_cbCMIsiRLs	127.0.0.1cSsdS(s?
            factory.clientConnectionLost callback
            tCCL((R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_cbCCLXscSsdS(s:
            protocol.connectionLost callback
            tCL((R((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt_cbCL^scsˆj|ddgƒdS(NR®R¬(Rd(R(R#(s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt	_cbGatherds(R@RRRR?RAR;RRMRNR-RiRXRÜR,RjRkRB(	R#RlR«R,RER­R¯R°R((R#Rns9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyttest_loseOrder;s(		!		(R)R*R3R±(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyRª6si
((RR3R¯R²Rštzope.interfaceRt
twisted.trialRttwisted.python.logRRRRRRRttwisted.internet.addressRttwisted.internet.interfacesR	R
ttwisted.protocolsRttwisted.test.proto_helpersRRRµR R3R+R4R4R@RcRAtTestCaseRKRƒR„RRÇRÊRËRÓRçRRRRRRR7R<R?RBRFRYR[RZR^RR`RlRoRpRqRrRsRvR{R|RŒRR™RžRªtresourcetImportErrort	getrlimitt
RLIMIT_NOFILEt	numRoundstnumberRounds(((s9/usr/lib/python2.7/dist-packages/twisted/test/test_tcp.pyt<module>sv$"8Ä		Ñ@]m'
µ	
e
\	
R7E"/8


Youez - 2016 - github.com/yon3zu
LinuXploit