-
Instead of the thread data, which didn't make sense.
-
This required adding a global stats object. It also contains a bit of refactor to make a type out of the derived counters.
-
Check events are placed in a sorted map based on the last activity and keep-alive interval of the client. This makes it more accurate and reduces system load because it saves unnecessary checking.
-
On server shutdown and when taking over a session. On disconnect, wills are queued first, we wait for the queueing to be done, then initiate disconnect. When TCP buffers are full and fds are not reported by epoll, the thread loop still exits and clients are just closed on exit.
-
This includes some logic to have threads finish their work before quitting.
-
Because clients can now also exist as dummy objects, I had to add some extra checks. Also split up handlePublish() and the new parsePublishData().
-
The behavior for MQTT3 clients in the same, but I replaced the term 'clean session' and described the behavior in MQTT5 terms, of 'clean start' and an expiry interval.
-
Most of it is limits we already implemented non-standard compliant.
-
This saves some allocations. This also meant having to set the C++ standard to 2014. The getCopy() methods of sessions and mqttpackets can't be changed, because of access errors (private).
-
Because that's what's it is now. A lot of code can be refactored to get the settings from this now, but I'm not going to do that yet.
-
I don't know what is a good value. I'm upping it, together with (the possibility of increasing) net.core.somaxconn and net.ipv4.tcp_max_syn_backlog. The listen backlog is truncated to somaxconn, to having a high value makes sense. It seems to fix the kernel TCP SYN flooding warnings, if also disabling SYN cookies.
-
This mutes all INFO and NOTICE. Also fixed the parsing of the log_subscriptions.
-
The file IO is blocking, so we don't want that in our thread loops.
-
This avoids changing which thread runs the code. Also let auth_plugin_serialize_init affect cleanup serialization.
-
It was a mistake that it ran inside the timer thread, which came to light by asserting the thread local authentication pointer (see a few commits ago).
-
There were bugs in which authentication object was used when, causing threadings bugs. Instead of getting from the 'sender', we can just store a thread local pointer.
-
Files are simple serialized bytes prefaced by lengths. File is hashed to verify integrity. This was also a good way preventing unexpected errors when trying to crash the parser by having it load a different file. This change includes some refactoring that was necessary: - It 'fixes' looking at the wrong thread's authentiction. This is still wrong though. It will be fixed by a thread local pointer in the next commit. - Deadlocks with yourself are handled in rwlockguard. - QoSPacketQueue is now a class. - Probably other tweaks.
-
This performs a whole lot better.
-
Also include a few stats.