-
Also fix the single warning CodeQL noticed
-
Useful if you want to take action when a connection to the broker is established or lost. For example, after a reconnection you can expect to receive all retained messages again on the topics you are subscribed too.
-
This is a breaking API change. The whole interface of this library now uses "std::string_view" instead of "std::string" / "std::string &". In result, we can now promise to only copy data once thoughout the library. For subscriptions, this is a copy once to read the data from the socket into a buffer. For publish, this is a copy once to write the data in a buffer to send over the socket. For publish, this doesn't change the memory footprint, as because "std::string &" was already taking care of this. For subscriptions however, it reduces the memory usage by a factor of three. And as result it helps with the throughput.
-
Some brokers work a lot better if you don't hammer everything on a single topic. Others are less fuzzed about it.
-
As the last-will is retained, multiple runs gave different results. By picking the topics better, this is no longer the case.
-
The specifications say that the broker MAY deduplicate messages on overlapping subscriptions. In result, some do, and some don't. It is now, by documentation, left to the user of this library to handle overlapping subscriptions properly, and depending on their broker, they may receive one or more times the same message when the subscriptions overlap.
-
Subscriptions are now stored in a tree-like structure, to quickly find the correct callbacks. This not only reduces the complexity from O(n) to O(logn), but also doesn't require stuff like regex. It does however require slightly more memory.
-
By using Happy Eyeballs, we stagger connections of a host resolves into multiple IPs. This is useful for IPv6 / IPv4 hosts, where one of the two can stutter. Sadly, creating a connection is rather complex, with many odd things that can happen along the way. For example, a writeable socket doesn't mean it is actually connected; it can also mean the socket is in an error state. This implementation is inspired by my own work on OpenTTD's variant of this.
-
All administration should been taken care of now, and the only thing remaining is creating connect/disconnect and implementing the sendXXX functions.
-
This contains no actual code yet, just the scaffolding to get started.