|
From: | Giuseppe Modugno |
Subject: | [lwip-users] MQTTs: connect after disconnect |
Date: | Tue, 2 Apr 2019 11:11:22 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
For example, if I unplug Ethernet cable, MQTT client detects connection failure (because of lacks of PINGRESP from server) and disconnect. The MQTT connection callback is normally called with status=MQTT_CONNECT_TIMEOUT, I fire a 3s timeout. In the timer callback, I call again mqtt_client_connect(), this time without success. As you can understand, I need to keep the connection to server up.
I'm investigating what happens and I found something strange. During mqtt_client_connect() many allocations were made with altcp_tls_new(). However I couldn't find where exactly those allocations are freed at disconnection time. I think I have some memory allocation problem during the second attempt, because the memory allocated during first connection isn't freed.
Another strange thing I noticed. Is it sure that mqtt_disconnect() shouldn't call connection callback registered in mqtt_client_connect()?
[Prev in Thread] | Current Thread | [Next in Thread] |