refactor: 按 WCH 官方 TCPServer 例程重写 TCP JSON server
核心变更:去掉 g_json_socket_client,listen socket 直接承载收发数据。 参考 EVT/EXAM/ETH/TCPServer 例程: - 创建 PROTO_TYPE_TCP socket → WCHNET_SocketListen - 同一 socket 处理 CONNECT + RECV + DISCONNECT + TIMEOUT - 不需要 'accepted socket' 检测 移除的复杂逻辑: - g_json_socket_client 变量及所有 'newly accepted' 检测代码 - WCHNET_HandleSockInt 第二路由条件(socketid!=listen,!=TCP,!=UDP 那串) - tcp_json_handle_sock_int 中 listen/client 分离处理 - listen==client overlap 的迂回保护 修改文件: - tcp_json_srv.h: 移除 g_json_socket_client extern - tcp_json_srv.c: 移除 g_json_socket_client,handler 简化为 4 个 if - net_srv.c: 路由简化为仅 socketid==g_json_socket_listen
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -67,7 +67,6 @@ mdk_v5/
|
||||
*.url
|
||||
*.txt
|
||||
|
||||
|
||||
at32_ide_proj/
|
||||
*.uvguix*
|
||||
*.cproject
|
||||
@@ -83,3 +82,6 @@ at32_ide_proj/
|
||||
*.pdf
|
||||
*.PDF
|
||||
|
||||
|
||||
wchreference/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user