Closed jmacwhyte closed 2 years ago
It looks like commit 2cfc08b560bdb3c6c8e5e0b157061a4551850d15 added in pub.Retain = retained
in an attempt to add retain flags, but this is strange because I don't see any Retain
variable declared in Eclipse's PublishPacket
, so I don't think this code is valid. @mek-x Please let me know if I'm missing something!
Hi @jmacwhyte, thanks for asking. Retain
is part of FixedHeader
defined here, which is nested anonymous struct field in PublishPacket
(hence Retain
can be accessed directly). Besides it must work, I'm using this implementation in my current project ;-)
@mek-x Aha, I didn't notice FixedHeader
was anonymous! Thanks for pointing that out. Either way will work, I guess.
I hope you try out this commit and let me know how it works for you, I think it is a big improvement!
@jmacwhyte can you please rebase against dev
to resolve the merge conflicts?
@deadprogram Absolutely, I'll clean it up later today and ping you when it's fixed.
@deadprogram All good to go! It's now a single commit on the top of dev.
Did some testing of my own, and it was working great. Thank you so very much for working on this @jmacwhyte and @mek-x for the previous additions and review.
Now merging.
This update adds in various functionality to allow MQTT clients to disconnect and reconnect gracefully. Notably:
IsConnected()
now accurately shows the connection status, andDisconnect()
now works to force a disconnect.Connect()
again on the existing instance of the mqtt client.I have tested consecutively disconnecting and reconnecting, and show no memory leaks.
Also,