예제 #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.connectTCP(host, port, factory, timeout=timeout)
예제 #3
0
 def _connect_to_reactor(self, host, port, factory, timeout):
     reactor.connectTCP(host, port, factory, timeout=timeout)