已经找到问题了,接收和发送的内存没有释放导致后面的数据都是错误的。但是现在最多只能连接2个客户端,连接3个客户端程序就会死掉,改了lwipopts文件,都改成四个,还是不行,rtos堆栈内存没有报错
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
connections. */
#define MEMP_NUM_TCP_PCB 4
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
connections. */
#define MEMP_NUM_TCP_PCB_LISTEN 4