暂时关闭网络判定,直接发送send_text,为了同步测试websocket断网重连死机问题 2997/2 2997/head 2998/target/1
author孙春阳 <snickersun@163.com>
Tue, 30 Dec 2025 03:58:30 +0000 (11:58 +0800)
committer孙春阳 <snickersun@163.com>
Tue, 30 Dec 2025 03:58:30 +0000 (11:58 +0800)
code/sdk/zhihui/websocket/os_ws/haisi_websocket.c

index 99f4e23..5abe331 100644 (file)
@@ -57,11 +57,11 @@ static const char *g_log_level_str[] = {
 
 /* 发送方式控制宏 */
 #ifndef WS_USE_SEND_QUEUE
-#define WS_USE_SEND_QUEUE 1  // 1=使用发送队列, 0=不使用发送队列
+#define WS_USE_SEND_QUEUE 0  // 1=使用发送队列, 0=不使用发送队列
 #endif
 
 #ifndef WS_SEND_DIRECT_ENABLE
-#define WS_SEND_DIRECT_ENABLE 0  // 0=通过队列发送, 1=直接发送(仅在WS_USE_SEND_QUEUE=0时有效)
+#define WS_SEND_DIRECT_ENABLE 1  // 0=通过队列发送, 1=直接发送(仅在WS_USE_SEND_QUEUE=0时有效)
 #endif
 
 /* 连接状态定义 */
@@ -868,7 +868,7 @@ int uapi_ws_send_text(const char *text)
     return 0;
 #else
     // 直接发送模式(WS_SEND_DIRECT_ENABLE=1 或 WS_USE_SEND_QUEUE=0)
-    int network_status = uapi_dev_runtime_get_cat1_networkstat();
+    int network_status = 1;//uapi_dev_runtime_get_cat1_networkstat();
     if (network_status != 1 || g_ws_connected != WS_STATE_CONNECTED || g_ws_client_fd < 0) {
         HAISI_WS_WARN("Cannot send text, connection state: %d , network_status: %d\n", g_ws_connected,network_status);
         return -1;
@@ -884,7 +884,7 @@ int uapi_ws_send_text(const char *text)
     // 发送数据
     HAISI_WS_WARN("uapi_ws_send_text \n");
     int ret = WebSocketClientSendText(g_ws_client_fd, text, strlen(text));
-    HAISI_WS_DEBUG("uapi_ws_send_text ret: %d\n", ret);
+    HAISI_WS_WARN("uapi_ws_send_text ret: %d\n", ret);
     
     // 更新最后发送时间
     if (ret == 0) {