ESP8266 Developer Zone The Official ESP8266 Forum 2016-12-05T18:10:59+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=3060 2016-12-05T18:10:59+08:00 2016-12-05T18:10:59+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3060&p=10802#p10802 <![CDATA[Re: RTOS SDK 1.4.0 espconn_tcp_set_max_con_allow crashes the code]]> Do you want to creat TCP_Server?you can consult our TCP_Server sample code,our sample code is ok.the link is:https://github.com/espressif/esp8266-rtos-sample-code/tree/master/04Protocal/TCP_Server_Demo

Statistics: Posted by ESP_Xutao — Mon Dec 05, 2016 6:10 pm


]]>
2016-11-10T19:19:46+08:00 2016-11-10T19:19:46+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3060&p=10498#p10498 <![CDATA[RTOS SDK 1.4.0 espconn_tcp_set_max_con_allow crashes the code]]> the following code crashes:

Code:

static struct espconn conn;
conn.type = ESPCONN_TCP;
conn.state = ESPCONN_NONE;
conn.proto.tcp = (esp_tcp *)zalloc(sizeof(esp_tcp));
conn.proto.tcp->local_port = port;
espconn_regist_connectcb(&conn, onNewClient);
espconn_accept(&conn);
espconn_tcp_set_max_con_allow(&conn, 2);
espconn_regist_time(&conn, CLIENT_TIMEOUT_S, 0);


If I remove the "espconn_tcp_set_max_con_allow" it does not.

I'm using RTOS SDK v1.4.0.

Statistics: Posted by gustavo — Thu Nov 10, 2016 7:19 pm


]]>