-
Only mqtt3 though.
-
This is a preparation for MQTT5, because when there are receivers and publishers with different protocols, you can't always just write out the same packet. You can sometimes though, so that's what the copy factory determines.
-
This entails making copies of the original packet when necessary, because QoS 0 doesn't have a packet id. I tried to keep it to an absolute minimum and do some precarious optmizations for it. There are tests though.
-
Three parts to it: - Start the app fresh per test. This avoids annoyances like getting retained messages on subscribe, messing up the test. - Waiting for suback was apparently necessary. - Because the Qt event loop was given time, waiting for publishes was sometimes pointless because it had already arrived. So, checking the receive list first.
-
The MQTT docs showed a wrong condition for checking malformed packets. And, we have to grow buffers to MAX_PACKET_SIZE, otherwise we can't process. I still have some inteligent buffer shrink logic in mind.
-
There still is a bug: writing a very big packet. I wrote the test case already.