* Add CMake support
* Remove unused 'tr()'
* Add option to specify a class for inheritance
* Use modern syntax
* Rework CMakeLists.txt
Thanks to @akallabeth
* Add CMake build rules for examples
Fix `comparison between signed and unsigned integer expressions` problem.
User ID is a positive integer in Linux/UNIX(macOS, FreeBSD, Solaris), also `geteuid()` never fails with return code.
* Process socket events asynchronously
Avoid blocking the event loop using waitForReadyRead(). Instead, process the
initialization in two phases. It was necessary to add a map to keep track of
the state of the initial message processing
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Fix undefined variable on Windows
The timout variable does not exists in this scope, we can safely remove the
Q_UNUSED.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Fix validation logic of initial message
I modified the logic to a positive value, but the modification was incomplete
and caused the initial message to be incorrectly considered as invalid.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Use the proper socket when receiving message
The socket variable is a class member, but we really want to use
nextConnSocket when receiving the message in the lambda.
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>
* Fix send message example
If a secondary instance sends a message immediately after connecting, the
message follows the init message. This causes the slotConnectionEstablished to
read and consume the tail of the message and interpret it as the checksum. The
checksum fails and the connection becomes invalid.
To avoid this race, we prefix the init message with its length. This way, we
consume only the data relevant to the init message.
This patch fixes the sending_arguments example.
Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
* Fix include file case
Signed-off-by: Francis Giraldeau <francis.giraldeau@nrc-cnrc.gc.ca>