fix: NET_SSC_ENABLE=0 时 g_net_state.flag 卡在 1 导致 tcp_json_srv_init 反复调用
WCHNET_CreateUdpSocket 原本会将 flag 推进到 2,被 #if 排除后 net_srv_init 每次主循环都重新执行,tcp_json_srv_init 首次成功后 后续 SocketCreat 都返回 0x1B(socket 已存在) 修复:SSC 禁用时在 tcp_json_srv_init 后手动设 flag=2
This commit is contained in:
@@ -1120,6 +1120,9 @@ void net_srv_init(void)
|
|||||||
WCHNET_CreateUdpSocket();
|
WCHNET_CreateUdpSocket();
|
||||||
#endif
|
#endif
|
||||||
tcp_json_srv_init(); // Start JSON protocol TCP listener on port 5960
|
tcp_json_srv_init(); // Start JSON protocol TCP listener on port 5960
|
||||||
|
#if !NET_SSC_ENABLE
|
||||||
|
g_net_state.flag = 2; // Skip SSC init, advance state directly
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user