code: def _socket_reconnect_and_wait_ready(self):
          
          logger.info("Start connecting: host={}; port={};".format(self.__host, self.__port))
          with self._lock:
              self._status = ContextStatus.Connecting
              # logger.info("try connecting: host={}; port={};".format(self.__host, self.__port))
              ret, msg, conn_id = self._net_mgr.connect((self.__host, self.__port), self, 5)
              if ret == RET_OK:
                  self._conn_id = conn_id
              else:
                  logger.warning(msg)
  
          if ret == RET_OK:
              while True:
                  with self._lock:
                      if self._sync_req_ret is not None:
                          if self._sync_req_ret.ret == RET_OK:
                              self._status = ContextStatus.Ready
                          else:
                              ret, msg = self._sync_req_ret.ret, self._sync_req_ret.msg
                          self._sync_req_ret = None
                          break
                  sleep(0.01)
  
          if ret == RET_OK:
              ret, msg = self.on_api_socket_reconnected()
          else:
              self._wait_reconnect()
          return RET_OK, ''
docs: sync_socket & async_socket recreate
          :return: (ret, msg)