Current Path : /usr/lib/python2.7/dist-packages/twisted/internet/test/ |
Current File : //usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyc |
ó B±Nc @ sÿ d Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l m Z m Z m Z d d l m Z m Z d d l m Z m Z d „ Z e Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( s? Various helpers for tests for connection-oriented transports. iÿÿÿÿ( t collect( t ref( t contextt log( t fullyQualifiedName( t ILogContextt msgt err( t Deferredt gatherResults( t ServerFactoryt Protocolc C s t ƒ } | | _ | S( s Helper function which returns a L{ServerFactory} which will build instances of C{protocol}. @param protocol: A callable which returns an L{IProtocol} provider to be used to handle connections to the port the returned factory listens on. ( R t protocol( R t factory( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyt serverFactoryFor s t _AcceptOneClientc B s e Z d Z d „ Z d „ Z RS( sM This factory fires a L{Deferred} with a protocol instance shortly after it is constructed (hopefully long enough afterwards so that it has been connected to a transport). @ivar reactor: The reactor used to schedule the I{shortly}. @ivar result: A L{Deferred} which will be fired with the protocol instance. c C s | | _ | | _ d S( N( t reactort result( t selfR R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyt __init__) s c C s2 t j | | ƒ } | j j d | j j | ƒ | S( Ni ( R t buildProtocolR t callLaterR t callback( R t addrR ( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyR . s ( t __name__t __module__t __doc__R R ( ( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyR s t ClosingLaterProtocolc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( sÕ ClosingLaterProtocol exchanges one byte with its peer and then disconnects itself. This is mostly a work-around for the fact that connectionMade is called before the SSL handshake has completed. c C s d | _ | | _ d S( N( t Nonet lostConnectionReasont onConnectionLost( R R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyR ; s c C s t d ƒ d S( Ns# ClosingLaterProtocol.connectionMade( R ( R ( ( sJ /usr/lib/python2.7/dist-packages/twisted/internet/test/connectionmixins.pyt connectionMade@ s c C s"