Change: [Network] Transfer command data as serialized byte stream without fixed structure.

The data will be transmitted as the length followed by the serialized data. This allows the command
data to be different for every command type in the future.
This commit is contained in:
Michael Lutz
2021-10-28 23:48:26 +02:00
parent b0990fcff7
commit a05fd7aa50
15 changed files with 455 additions and 35 deletions

View File

@@ -72,6 +72,7 @@ public:
void Send_uint32(uint32 data);
void Send_uint64(uint64 data);
void Send_string(const std::string_view data);
void Send_buffer(const std::vector<byte> &data);
size_t Send_bytes (const byte *begin, const byte *end);
/* Reading/receiving of packets */
@@ -87,6 +88,7 @@ public:
uint16 Recv_uint16();
uint32 Recv_uint32();
uint64 Recv_uint64();
std::vector<byte> Recv_buffer();
std::string Recv_string(size_t length, StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK);
size_t RemainingBytesToTransfer() const;