deepessh/mqttclpro

reconnect before timeout reached

Closed this issue · 3 comments

Hi,
if I stop/start the wifi, mqtt begins another session even if the timeout is not reached.

1523962298: New connection from xxx on port 1883.
1523962298: Client 123456 already connected, closing old connection.

It should not: It means to receive again all message subscribed (and retained) every time it loses for a few seconds.

If pingreq is sent (before connection lost), It should wait a pingresp until timeout fires.
If pingreq can't be sent (no connection), It should try until timeout fires.
IMHO
Thanks for this usefull app.
Enrico

Hi @brnnrc

Thanks for raising the issue.

Let me look into the possibilities.

Regards

Hey, in Android, if the connection changes, the connection will definitely be lost. If I don't implement the network change listener you'll be losing out on messages published during the time the connection changed and the next ping request is sent.

Thanks for you job. Sorry for my wrong issue.
On ethernet (linux) pc, I didn't find those log entries in the same situation because the tcp socket last between hardware reconnect, if it happens before timeout. So your implementation is correct. My problem was that I got duplicates mqtt messages on reconnect in QOS level 2 too.
I tried yust now and this issue seems gone... or I was drunk :-)
My apologies
Thanks
Enrico