esp8266向http server发送post请求,发送一段时间之后,会返回ESPCONN_MEM错我

oldeagle
Posts: 2
Joined: Wed Jul 19, 2017 7:18 pm

esp8266向http server发送post请求,发送一段时间之后,会返回ESPCONN_MEM错我

Postby oldeagle » Tue Apr 24, 2018 1:36 pm

我用ESP8266做client向HTTP sever发送post请求,发送一段时间之后,调用espconn_send就会返回ESPCONN_MEM,我是等上一包数据发完之后,进入了sent callback,然后再发下一包,我不知道tcp_pcb是在哪儿close和删除的,我尝试在disconnect callback和reconnect callback中调用espconn_delete或espconn_disconnect,都不行,不知道问题出在哪儿.
void ICACHE_FLASH_ATTR disconnect_callback(void *arg)
{
struct espconn *conn = (struct espconn *)arg;
sint8 error = espconn_delete(conn);
//sint8 error = espconn_disconnect(conn);
if(conn == NULL)
return;
if(conn->proto.tcp != NULL) {
os_free(conn->proto.tcp);
conn->proto.tcp = NULL;
}
os_free(conn);
user_conn = NULL;
if(error != 0){
char str[30];
os_sprintf(str, " delete err: %d", error);
uart0_sendStr(str);
}
}

Who is online

Users browsing this forum: No registered users and 2 guests