我的TCP server在不使用超时设置时会不定期的断开连接,我使用了如下代码设置:
espconn_regist_connectcb(&ws_config.server_conn, server_connect_callback);
espconn_accept(&ws_config.server_conn);
//set tcp server timeout to 60s
espconn_regist_time(&ws_config.server_conn, 60, 1);
但是,设置似乎并没有发挥作用。有时十几秒就断开了。
如果最后一行改为如下设置:
espconn_regist_time(&ws_config.server_conn, 60, 0);
超时时间似乎挥作用了,但是连接断开时不激发espconn_reconnect_callback和espconn_disconnect_callback.致使我无法释放资源。
请问:我的设置有什么问题么?
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.