code: def _select_next_server(self):
          
  
          # Continue trying to connect until there is an available server
          # or bail in case there are no more available servers.
          while True:
              if len(self._server_pool) == 0:
                  self._current_server = None
                  raise ErrNoServers
  
              now = time.time()
              s = self._server_pool.pop(0)
              if self.options["max_reconnect_attempts"] > 0:
                  if s.reconnects > self.options["max_reconnect_attempts"]:
                      # Discard server since already tried to reconnect too many times.
                      continue
  
              # Not yet exceeded max_reconnect_attempts so can still use
              # this server in the future.
              self._server_pool.append(s)
              if s.last_attempt is not None and now < s.last_attempt + self.options["reconnect_time_wait"]:
                  # Backoff connecting to server if we attempted recently.
                  yield tornado.gen.sleep(self.options["reconnect_time_wait"])
  
              try:
                  yield self._server_connect(s)
                  self._current_server = s
                  break
              except Exception as e:
                  s.last_attempt = time.time()
                  s.reconnects += 1
  
                  self._err = e
                  if self._error_cb is not None:
                      self._error_cb(e)
                  self._status = Client.RECONNECTING
                  continue
docs: Looks up in the server pool for an available server
          and attempts to connect.