示例#1
0
 def connect(self, host, port):
     self._stack_conn = _Connection()
     self._stack_conn.attach(self)
     self._stack_conn.connect_cb = Callback()
     factory = ClientFactory()
     factory.protocol = lambda: self._stack_conn
     factory.clientConnectionFailed = self.clientConnectionFailed
     if self.ssl_options is not None:
         reactor.connectSSL(host, port, factory,
                            SSLContextFactory(self.ssl_options))
     else:
         reactor.connectTCP(host, port, factory)
     yield self._stack_conn.connect_cb
示例#2
0
文件: __init__.py 项目: sah/monocle
 def _connect_to_reactor(self, host, port, factory, timeout):
     reactor.connectSSL(host, port, factory, SSLContextFactory(self.ssl_options), timeout=timeout)
示例#3
0
 def _connect_to_reactor(self, host, port, factory, timeout):
     reactor.connectSSL(host, port, factory,
                        SSLContextFactory(self.ssl_options),
                        timeout=timeout)