I having some problems using espconn with RTOS SDK 1.3. I am able to open a TCP connection as a client - connect, receive data, stay idle. When remote closes connection (due to timeout), I do not get a disconnection callback.
Code: Select all
//create tcp connection like this
...
connection.type=ESPCONN_TCP;
connection.state=ESPCONN_NONE;
connection.proto.tcp=&tcp;
tcp.local_port = espconn_port();
tcp.remote_port = 1234;
memcpy(&tcp.remote_ip, &ip, 4);
espconn_regist_connectcb(&connection, network_connected_cb); //called
espconn_regist_disconcb(&connection, network_disconnected_cb); //not called
espconn_regist_reconcb(&connection, network_reconnected_cb); //not called
espconn_regist_recvcb(&connection, network_receive_cb); //called
espconn_connect(&connection);
Here's what I see in the console
Code: Select all
...
espconn_client_connect, regist espconn_client_recv
network_connected_cb
network_receive_cb
RX: blah blah blah
//*** some time passes, remote closes connection due to inactivity ***
espconn_client_recv, espconn_client_close, err:0, p: 0
espconn_client_close, close
//*** network_disconnected_cb should be here, but it isn't ***