keepalive does not work for me. what am I doing wrong?
Posted: Wed Feb 24, 2016 9:56 am
Hello,
I'm new to ESP8266 so I make some kind of mistake. I have a code like below in my espconn_regist_connectcb callback:
I try many different combinations but the TCP connection seems to disconnect always after 10 seconds or so.
What am I doing wrong?
I'm new to ESP8266 so I make some kind of mistake. I have a code like below in my espconn_regist_connectcb callback:
Code: Select all
uint32 nKeepAliveParam = 10;
espconn_set_keepalive(conn, ESPCONN_KEEPIDLE, &nKeepAliveParam);
nKeepAliveParam = 2;
espconn_set_keepalive(conn, ESPCONN_KEEPINTVL, &nKeepAliveParam);
nKeepAliveParam = 10;
espconn_set_keepalive(conn, ESPCONN_KEEPCNT, &nKeepAliveParam);
espconn_set_opt(conn, ESPCONN_KEEPALIVE);
espconn_regist_time(conn, 180, 0);
I try many different combinations but the TCP connection seems to disconnect always after 10 seconds or so.
What am I doing wrong?