8266连续调用espconn_send或者espconn_sent,数据会丢的很严重
8266连续调用espconn_send或者espconn_sent,数据会丢的很严重
Postby grantgao » Fri Feb 05, 2016 2:51 pm
8266连续调用espconn_send或者espconn_sent,数据会丢的很严重。例如,有8个字节的数据,如果调用espconn_send一次发送,则没有任何问题。如果在一个while里分成8次调用,每次只发送1字节,则基本上数据全都发不出去,大部分情况只有第一个字节能发出去,后面7个都报-7错误?怎么回事啊?我用1.1.0的和1.5.2的sdk都试过,现象都如此。紧急求救!我们有一个需求用到这种发送场景。能否不用sent_callback的。因为像linux套接字,udp或tcp发送的都不需要sent-Callback。而且我看了,espconn_send会返回-7-------------------UDP和TCP都是这种情况
Re: 8266连续调用espconn_send或者espconn_sent,数据会丢的很严重
Postby ESP_Faye » Fri Feb 05, 2016 3:48 pm
您好,
非常抱歉,espconn_send 需要等到 espconn_sent_callback 再发下一包。
您可以调用 espconn_regist_write_finish,增加发包缓存,这样能最多缓存 8 包(或者 2920 bytes)数据,一旦缓存满了,仍然会报 -7 错误,也就是达到发包缓存上限。
或者您可以使用 RTOS SDK,它支持直接使用 socket 编程。
非常抱歉,espconn_send 需要等到 espconn_sent_callback 再发下一包。
您可以调用 espconn_regist_write_finish,增加发包缓存,这样能最多缓存 8 包(或者 2920 bytes)数据,一旦缓存满了,仍然会报 -7 错误,也就是达到发包缓存上限。
或者您可以使用 RTOS SDK,它支持直接使用 socket 编程。
Who is online
Users browsing this forum: No registered users and 16 guests
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.