Closed andsel closed 1 year ago
Hi @hylkevds, this is one of the MQTT5 PRs to solve the items in meta #695.
It mainly changes the MQTTConnection
and Session
to send the retries of inflight PUB and PUBREL only when a client with same clientd and not cleanStart connects, and not on timeout basis like implemented for MQTT3.
I ask if you would like be the reviewer of this changes :-)
Of course I'll be happy to review :) May take a bit though...
Thank you a lot, no hurry :-)
Originally Moquette sent retries of PUB and PUBREL packets basing on a ACK timeout. This made to re-send PUB also on open TCP connections. With MQTT5 - 4.4.0-1 it's specified that retries must happen only on reconnected not clean start sessions.
What it does
This PR stores the MQTT version into the Session instance and use that to keep the existing behavior for inflight resends (happening on a timeout basis on ACK received) in case the version is MQTT 3.1 or MQTT 3.1.1. When the version of the Session is MQTT 5 it removes the resend on PUB ACK timeouts and switch to send only in case the same client reconnects with
cleanStart
= 0 and there is any peding publishes in the flight zone to get acknowledged.To test this use the raw
Client
has been extended, so now can also subscribe and collect publish messages.