diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-04-30 10:06:28 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-05-26 18:41:21 +0200 |
commit | 0243cbe0170a768f8f8998c6f7f234869c8c77e6 (patch) | |
tree | 9a55ed100042a82dad8489286e06c1341b06448a /src/client.cc | |
parent | 5e351b7783e5ad135b6918b5f5d92d78723a4a04 (diff) |
Add 4-byte size arg to socket payload. Add qookie-cast client (server really) with receiving socket.
Diffstat (limited to 'src/client.cc')
-rw-r--r-- | src/client.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc index bcc7958..4d1bb7f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1,5 +1,7 @@ #include "client.h" +#include <cstdint> + #include <QTcpSocket> #include <QTimer> @@ -33,6 +35,8 @@ bool Client::writeData(const QByteArray& data) return false; } + std::uint32_t size = data.size(); + socket->write((char*)&size, sizeof(std::uint32_t)); socket->write(data); return socket->waitForBytesWritten(100); // wait at most 100ms } |