Chat freely about anything...

User avatar
By RogerClark
#6161 Hi,

I'm not sure if espconn_disconnect always works. I have a callback setup for disconnect, but I don't get it every time that I call espconn_disconnect()

So either disconnect is not working, or the callback system is not working

Has anyone else experienced this ?
User avatar
By RogerClark
#6199 Update.

I think the issue is that the disconnect callback doesn't work if the remote connection does the disconnection rather than the ESP8266 doing the disconnection.

I my code, I open a TCP socket to port 80 on a web server, in order to do a HTTP POST of some data to a web service, however in the POST data, I specify connection: Close which tells the web server to close the connection.

I'm not an expect in TCPIP so I'm not even sure if it is possible for the ESP8266 to determine if the connection has been disconnected by the remote server.

I've searched the web and I can't seem to find much information about TCP socket disconnect callbacks (or notifications), so perhaps this isn't technically possible with TCP.
User avatar
By RogerClark
#6221 @Athena

Thanks.

I will add the reconnect callback and see if that is called instead

I have seen one time that the disconnect callback was received, but I don't know what was different at that time, normally I do get the disconnect callback :-(