incorrect espconn pointer in callbacks

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

incorrect espconn pointer in callbacks

Postby tve » Sun Jun 14, 2015 2:45 pm

For TCP connections the void *arg pointer passed to the espconn_reconnect_callback and the espconn_disconnect_callback functions has the value of the listening/accepting connection instead of the disconnected connection. This makes it difficult to find the connection that has been closed and release resources.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: incorrect espconn pointer in callbacks

Postby ESP_Faye » Mon Jun 15, 2015 10:25 am

Hi,

So sorry for the inconvenience.

Please refer to documentation "2C-ESP8266__SDK__Programming Guide" -> 8.Appendix -> 8.1 ESPCONN Programming -> 3. espconn callback

The pointer may be different in different callbacks, please use parameter remote_ip and remote_port instead.

Thanks for your interest in ESP8266 !

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: incorrect espconn pointer in callbacks

Postby kolban » Thu Jul 09, 2015 12:35 pm

I think we may also be able to place context in a field of struct espconn called "reverse". I am thinking that if this is set in the connection callback then it will be passed in to other callbacks in the future. However ... I won't swear to that. There is a hint that this might be what is happening ... but there is no solid confirmation ... that I know off ... at this time.

tve
Posts: 123
Joined: Sun Feb 15, 2015 4:33 pm

Re: incorrect espconn pointer in callbacks

Postby tve » Thu Jul 09, 2015 12:46 pm

use remote_id and remote_port, that works, it's idiotic, but whatever...

Who is online

Users browsing this forum: No registered users and 31 guests