def __init__(self, wrappedFactory):
        """Constructor.

        See WrappingFactory.__init__.
        """
        WrappingFactory.__init__(self, wrappedFactory)
        self.allConnectionsGone = None
示例#2
0
    def __init__(self, wrappedFactory, maxConnectionCount=sys.maxint):
        WrappingFactory.__init__(self, wrappedFactory)
        self.connectionCount = 0
        self.maxConnectionCount = maxConnectionCount

        self.ht = Hellanzb.ht
        self.ht.factories.append(self)
示例#3
0
    def __init__(self, wrappedFactory):
        """Constructor.

        See WrappingFactory.__init__.
        """
        WrappingFactory.__init__(self, wrappedFactory)
        self.allConnectionsGone = None
示例#4
0
    def __init__(self, wrappedFactory, maxConnectionCount=sys.maxint):
        WrappingFactory.__init__(self, wrappedFactory)
        self.connectionCount = 0
        self.maxConnectionCount = maxConnectionCount

        self.ht = Hellanzb.ht
        self.ht.factories.append(self)
示例#5
0
文件: whitelist.py 项目: sipior/Comet
 def __init__(self,
              wrappedFactory,
              whitelist,
              connection_type="connection"):
     self.whitelist = whitelist
     self.connection_type = connection_type
     WrappingFactory.__init__(self, wrappedFactory)
示例#6
0
    def __init__(self, contextFactory, isClient, wrappedFactory):
        WrappingFactory.__init__(self, wrappedFactory)
        self._contextFactory = contextFactory
        self._isClient = isClient

        # Force some parameter checking in pyOpenSSL.  It's better to fail now
        # than after we've set up the transport.
        contextFactory.getContext()
示例#7
0
文件: tls.py 项目: AmirKhooj/VTK
    def __init__(self, contextFactory, isClient, wrappedFactory):
        WrappingFactory.__init__(self, wrappedFactory)
        self._contextFactory = contextFactory
        self._isClient = isClient

        # Force some parameter checking in pyOpenSSL.  It's better to fail now
        # than after we've set up the transport.
        contextFactory.getContext()
示例#8
0
    def __init__(self, contextFactory, isClient, wrappedFactory):
        """
        Create a L{TLSMemoryBIOFactory}.

        @param contextFactory: Configuration parameters used to create an
            OpenSSL connection.  In order of preference, what you should pass
            here should be:

                1. L{twisted.internet.ssl.CertificateOptions} (if you're
                   writing a server) or the result of
                   L{twisted.internet.ssl.optionsForClientTLS} (if you're
                   writing a client).  If you want security you should really
                   use one of these.

                2. If you really want to implement something yourself, supply a
                   provider of L{IOpenSSLClientConnectionCreator} or
                   L{IOpenSSLServerConnectionCreator}.

                3. If you really have to, supply a
                   L{twisted.internet.ssl.ContextFactory}.  This will likely be
                   deprecated at some point so please upgrade to the new
                   interfaces.

        @type contextFactory: L{IOpenSSLClientConnectionCreator} or
            L{IOpenSSLServerConnectionCreator}, or, for compatibility with
            older code, anything implementing
            L{twisted.internet.interfaces.IOpenSSLContextFactory}.  See
            U{https://twistedmatrix.com/trac/ticket/7215} for information on
            the upcoming deprecation of passing a
            L{twisted.internet.ssl.ContextFactory} here.

        @param isClient: Is this a factory for TLS client connections; in other
            words, those that will send a C{ClientHello} greeting?  L{True} if
            so, L{False} otherwise.  This flag determines what interface is
            expected of C{contextFactory}.  If L{True}, C{contextFactory}
            should provide L{IOpenSSLClientConnectionCreator}; otherwise it
            should provide L{IOpenSSLServerConnectionCreator}.
        @type isClient: L{bool}

        @param wrappedFactory: A factory which will create the
            application-level protocol.
        @type wrappedFactory: L{twisted.internet.interfaces.IProtocolFactory}
        """
        WrappingFactory.__init__(self, wrappedFactory)
        if isClient:
            creatorInterface = IOpenSSLClientConnectionCreator
        else:
            creatorInterface = IOpenSSLServerConnectionCreator
        self._creatorInterface = creatorInterface
        if not creatorInterface.providedBy(contextFactory):
            contextFactory = _ContextFactoryToConnectionFactory(contextFactory)
        self._connectionCreator = contextFactory
示例#9
0
    def __init__(self, contextFactory, isClient, wrappedFactory):
        """
        Create a L{TLSMemoryBIOFactory}.

        @param contextFactory: Configuration parameters used to create an
            OpenSSL connection.  In order of preference, what you should pass
            here should be:

                1. L{twisted.internet.ssl.CertificateOptions} (if you're
                   writing a server) or the result of
                   L{twisted.internet.ssl.optionsForClientTLS} (if you're
                   writing a client).  If you want security you should really
                   use one of these.

                2. If you really want to implement something yourself, supply a
                   provider of L{IOpenSSLClientConnectionCreator} or
                   L{IOpenSSLServerConnectionCreator}.

                3. If you really have to, supply a
                   L{twisted.internet.ssl.ContextFactory}.  This will likely be
                   deprecated at some point so please upgrade to the new
                   interfaces.

        @type contextFactory: L{IOpenSSLClientConnectionCreator} or
            L{IOpenSSLServerConnectionCreator}, or, for compatibility with
            older code, anything implementing
            L{twisted.internet.interfaces.IOpenSSLContextFactory}.  See
            U{https://twistedmatrix.com/trac/ticket/7215} for information on
            the upcoming deprecation of passing a
            L{twisted.internet.ssl.ContextFactory} here.

        @param isClient: Is this a factory for TLS client connections; in other
            words, those that will send a C{ClientHello} greeting?  L{True} if
            so, L{False} otherwise.  This flag determines what interface is
            expected of C{contextFactory}.  If L{True}, C{contextFactory}
            should provide L{IOpenSSLClientConnectionCreator}; otherwise it
            should provide L{IOpenSSLServerConnectionCreator}.
        @type isClient: L{bool}

        @param wrappedFactory: A factory which will create the
            application-level protocol.
        @type wrappedFactory: L{twisted.internet.interfaces.IProtocolFactory}
        """
        WrappingFactory.__init__(self, wrappedFactory)
        if isClient:
            creatorInterface = IOpenSSLClientConnectionCreator
        else:
            creatorInterface = IOpenSSLServerConnectionCreator
        self._creatorInterface = creatorInterface
        if not creatorInterface.providedBy(contextFactory):
            contextFactory = _ContextFactoryToConnectionFactory(contextFactory)
        self._connectionCreator = contextFactory
示例#10
0
 def __init__(self, wrappedFactory):
     WrappingFactory.__init__(self, wrappedFactory)
     self.logs = []
     self.finishedLogs = []
示例#11
0
 def __init__(self, wrappedFactory, allowedRequests):
     WrappingFactory.__init__(self, wrappedFactory)
     self.requests_countdown = allowedRequests
示例#12
0
 def __init__(self, contextFactory, isClient, wrappedFactory):
     WrappingFactory.__init__(self, wrappedFactory)
     self._contextFactory = contextFactory
     self._isClient = isClient
示例#13
0
 def __init__(self, wrappedFactory):
     WrappingFactory.__init__(self, wrappedFactory)
     self.logs = []
     self.finishedLogs = []
示例#14
0
 def __init__(self, realFactory):
     WrappingFactory.__init__(self, realFactory)
     self.connectionNotification = Deferred()
示例#15
0
 def __init__(self, wrappedFactory, writeLimit):
     WrappingFactory.__init__(self, wrappedFactory)
     self.writeLimit = writeLimit
示例#16
0
 def __init__(self, wrappedFactory, host, port, optimistic):
     WrappingFactory.__init__(self, wrappedFactory)
     self._host = host
     self._port = port
     self._optimistic = optimistic
     self._onConnection = defer.Deferred()
示例#17
0
文件: protocol.py 项目: hhco/txdarn
 def __init__(self, wrappedFactory, heartbeatPeriod=25.0, clock=reactor):
     WrappingFactory.__init__(self, wrappedFactory)
     self.heartbeatPeriod = heartbeatPeriod
     self.clock = clock
示例#18
0
 def __init__(self, wrappedFactory, allowedRequests):
     WrappingFactory.__init__(self, wrappedFactory)
     self.requests_countdown = allowedRequests
示例#19
0
 def __init__(self, wrappedFactory, writeLimit):
     WrappingFactory.__init__(self, wrappedFactory)
     self.writeLimit = writeLimit
示例#20
0
 def __init__(self, wrappedFactory, whitelist, connection_type="connection"):
     self.whitelist = whitelist
     self.connection_type = connection_type
     WrappingFactory.__init__(self, wrappedFactory)
示例#21
0
文件: protocol.py 项目: hhco/txdarn
 def __init__(self, wrappedFactory, jsonEncoder=None, jsonDecoder=None):
     WrappingFactory.__init__(self, wrappedFactory)
     self.jsonEncoder = jsonEncoder
     self.jsonDecoder = jsonDecoder
示例#22
0
 def __init__(self, wrappedFactory, host, port, optimistic):
     WrappingFactory.__init__(self, wrappedFactory)
     self._host = host
     self._port = port
     self._optimistic = optimistic
     self._onConnection = defer.Deferred()
示例#23
0
文件: tls.py 项目: antong/twisted
 def __init__(self, contextFactory, isClient, wrappedFactory):
     WrappingFactory.__init__(self, wrappedFactory)
     self._contextFactory = contextFactory
     self._isClient = isClient
示例#24
0
 def __init__(self, host, port, wrappedFactory):
     self.host = host
     self.port = port
     self.deferred = defer.Deferred(self._cancel)
     WrappingFactory.__init__(self, wrappedFactory)
示例#25
0
 def __init__(self, host, port, wrappedFactory):
     self.host = host
     self.port = port
     self.deferred = defer.Deferred(self._cancel)
     WrappingFactory.__init__(self, wrappedFactory)
示例#26
0
文件: ui.py 项目: molock/game
	def __init__(self, realFactory):
		WrappingFactory.__init__(self, realFactory)
		self.connectionNotification = Deferred()
示例#27
0
 def __init__(self, wrappedFactory, whitelist):
     self.whitelist = whitelist
     WrappingFactory.__init__(self, wrappedFactory)