Browse Source

fix: netclient_thread_entry发送的CONNECT标志错了

Wendal Chen 5 năm trước cách đây
mục cha
commit
6ee1e9692e
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      luat/rtt/luat_netclient_rtt.c

+ 2 - 2
luat/rtt/luat_netclient_rtt.c

@@ -380,14 +380,14 @@ static void netclient_thread_entry(void *param)
     if (socket_init(thiz, thiz->hostname, thiz->port) != 0) {
         LOG_W("netc[%ld] connect fail", thiz->id);
         if (thiz->rx) {
-            EVENT(thiz->id, thiz->rx, thiz->cb_connect, NETC_EVENT_CONNECT_OK, 0, RT_NULL);
+            EVENT(thiz->id, thiz->rx, thiz->cb_connect, NETC_EVENT_CONNECT_FAIL, 0, RT_NULL);
         }
         goto netc_exit;
     }
     else {
         LOG_I("netc[%ld] connect ok", thiz->id);
         if (thiz->rx) {
-            EVENT(thiz->id, thiz->rx, thiz->cb_connect, NETC_EVENT_CONNECT_FAIL, 0, RT_NULL);
+            EVENT(thiz->id, thiz->rx, thiz->cb_connect, NETC_EVENT_CONNECT_OK, 0, RT_NULL);
         }
     }