code: def connect(self, timeout=None):
          
          # Start KATCP device client.
          assert not self._running
          maybe_timeout = future_timeout_manager(timeout)
  
          self._logger.debug('Starting katcp client')
          self.katcp_client.start()
          try:
              yield maybe_timeout(self.katcp_client.until_running())
              self._logger.debug('Katcp client running')
          except tornado.gen.TimeoutError:
              self.katcp_client.stop()
              raise
  
          if timeout:
              yield maybe_timeout(self.katcp_client.until_connected())
          self._logger.debug('Katcp client connected')
  
          self._running = True
          self._state_loop()
docs: Connect to KATCP interface, starting what is needed
  
          Parameters
          ----------
          timeout : float, None
              Time to wait until connected. No waiting if None.
  
          Raises
          ------
  
          :class:`tornado.gen.TimeoutError` if the connect timeout expires