code: def _recover_network_failure(self):
          
          if self.auto_reconnect and not self._is_closing:
              connected = False
              while not connected:
                  log_msg = "* ATTEMPTING RECONNECT"
                  if self._retry_new_version:
                      log_msg = "* RETRYING DIFFERENT DDP VERSION"
                  self.ddpsocket._debug_log(log_msg)
                  time.sleep(self.auto_reconnect_timeout)
                  self._init_socket()
                  try:
                      self.connect()
                      connected = True
                      if self._retry_new_version:
                          self._retry_new_version = False
                      else:
                          self._is_reconnecting = True
                  except (socket.error, WebSocketException):
                      pass
docs: Recover from a network failure