esp8266作为client向http server发送post请求,发送一段时间就会ESPCONN_MEM

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

esp8266作为client向http server发送post请求,发送一段时间就会ESPCONN_MEM

Postby oldeagle » Tue Apr 24, 2018 10:06 am

我用esp8266作为client向http server发送post请求,发送10几分钟之后,espconn_send就会返回ESPCONN_MEM错误,上一包数据发送完成,进入sent callback之后我再发下一条post请求.我怀疑是连接的tcp_pcb没有释放掉,可是我不知道该如何释放,我在disconnect 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->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