Open nwf opened 2 months ago
https://github.com/zhaojh329/lua-eco/blob/3b69a48ca3ac50f48ea0a09996d78e49b72a44ca/mqtt.lua#L181 will retransmit messages even if the TCP link is healthy, such that the earlier copies are still likely to reach the broker. AIUI, retransmission should occur only in the case that the connection drops and is re-established and this is mandated in MQTT 5 (see https://www.hivemq.com/blog/mqtt5-essentials-part2-foundational-changes-in-the-protocol/ , though I'm having trouble finding the claimed prohibition in the actual spec document).
I am really confused about the mqtt message retransmission mechanism. You are welcome to submit your code to improve it.
https://github.com/zhaojh329/lua-eco/blob/3b69a48ca3ac50f48ea0a09996d78e49b72a44ca/mqtt.lua#L181 will retransmit messages even if the TCP link is healthy, such that the earlier copies are still likely to reach the broker. AIUI, retransmission should occur only in the case that the connection drops and is re-established and this is mandated in MQTT 5 (see https://www.hivemq.com/blog/mqtt5-essentials-part2-foundational-changes-in-the-protocol/ , though I'm having trouble finding the claimed prohibition in the actual spec document).