Exemplo n.º 1
0
 def connect(self):
     _logger.debug('[%s]: Opening new connection to "%s"' %
                   (CLIENT, str(self._host)))
     stream = yield self._job_client.connect(self._host,
                                             self._port,
                                             ssl_options=self._ssl_options)
     self._connection = TCPConnection(stream,
                                      self._host,
                                      SERVER,
                                      on_close_callback=self.shutdown)
     _logger.info('[%s]: Connected to "%s"' % (CLIENT, str(self._host)))
 def handle_stream(self, stream, address):
     self.streams[stream] = time.time()
     conn = TCPConnection(stream, address, CLIENT)
     handler = TCPConnectionHandler(self, conn)
     yield handler.run()