As we moved most of the creation of a BufferPool to be via the
Streaming::pool() method, which uses a thread-local, it makes sense
to start cleaning up the design and make it more modern C++.
The above mentioned method would return a reference and you'd see
loads of places use `auto &pool =` which is less than ideal.
As the number of places where we actually instantiate a BufferPool
goes down, the usage of some sort of smart pointer makes more sense.
This now makes all APIs use BufferPool be wrapped in a shared_ptr.
THe builder now allows you to create a message with the
serviceId, the messageId and the requestId pre-set.
This benefits code that just takes the output from the
builder and calls 'send' on it immediately saving several
lines of code.
Move some files back to the server "library".
Merge the 'console' lib with server, as it doesn't really make sense with
just one file and nobody exclusively linking to it.
The server "libary" is not really a library, its the place we put all
the files shared by hub-qt hub-cli and hub.
We no longer depend on these files from other places (mostly due to
moving to the new logging framework) and as such we can move the files
back.
This is an overload of message() specifically meant to build
replies to incoming messages.
The behaviour changed here is that incoming messages with
headers other than "RequestId" now get copied to the outgoing
message by default.
Move the creation of the ping message to the constructor (from the
connection-established method) so we are certain it gets done exactly
once.
Also avoid putting default (invalid) values in the hashmap.
The compact-message-format has numberic limits that were not
being managed well.
This unit test makes sure we keep the limits at;
Negative number is 0x7FFFFFFF (aka INT_MIN)
Positive number max is 0xFFFFFFFFFFFFFFFF (aka ULONG_LONG_MAX)
The inconsistent limits is because the API. We use ints for negative
numbers and unsigned-longs for larger numbers.
This keeps the API simpler for the common cases.