aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-26 16:26:34 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-26 16:28:46 +0200
commitdc5c9fd10aa6ba4d1e5581cc1d5d2f0414b6efcd (patch)
tree4339cc9280b5706e6a64c078720ade8d94c7775b /common.h
parentcafda3e8a60043629cd9a51490496b8cfd3cd921 (diff)
Use dynamic limits for buffers
Use arenas where possible to have growable buffers - Use of bufArena in server and client for receiving&sending messages - Use of inputArena in client Also organized code
Diffstat (limited to 'common.h')
-rw-r--r--common.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/common.h b/common.h
index 60d8984..700d741 100644
--- a/common.h
+++ b/common.h
@@ -13,12 +13,11 @@
#define TIMESTAMP_LEN 9
// port to listen on
#define PORT 9983
-// buffer size for holding data received from recv()
-// TODO: choose a good size
-#define STREAM_BUF 1024
-// max data received in one recv() call on serverfd
-// TODO: choose a good size
-#define STREAM_LIMIT 1024
+// How much bytes can be sent at once over the stream
+// This is also Intial size for buffer used to send and receive data,
+// "initial" because the buffer is tied to an arena and can grow.
+// Note: must be greater than sizeof(Message) - sizeof(Message.text)
+#define STREAM_LIMIT 64
typedef uint8_t u8;
typedef uint16_t u16;