我用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);
}
}
0