aboutsummaryrefslogtreecommitdiff
path: root/v2/README.md
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-24 23:14:18 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-24 23:14:18 +0200
commit66a153c5012f0237bdf67b79b5cc6b2f5f496879 (patch)
treeb59dfad2b36a8cb49fda7d22145ba711d294e894 /v2/README.md
parentf37cce374cc9da243fc2babbea9a7051f15db80a (diff)
Initial draft for v2
This is a rewrite of v1 using arena's as memory allocators. The other great difference is using wide strings by default (wchar_t) because that will be needed in the future to print pretty UIs.
Diffstat (limited to 'v2/README.md')
-rw-r--r--v2/README.md52
1 files changed, 52 insertions, 0 deletions
diff --git a/v2/README.md b/v2/README.md
new file mode 100644
index 0000000..17f3be5
--- /dev/null
+++ b/v2/README.md
@@ -0,0 +1,52 @@
+# Chatty
+The idea is the following:
+- tcp server that you can send messages to
+- history upon connecting
+- date of messages sent
+- authentication
+- encrypted communication (tls?)
+- client for reading the messages and sending them at the same time
+
+- rooms
+- encryption
+- authentication
+
+## client
+- wrapping messages
+- prompt
+- sending message
+
+## server
+- log messages
+- check if when sending and the client is offline (due to connection loss) what happens
+- timeout on recv?
+
+## common
+- handle messages that are too large
+- connect/disconnections messages
+- use IP address / domain
+- chat history
+
+## Protocol
+For now the protocol consists of sending Message type over the network, but in the future something
+more flexible might be required. Because it will make it easier to do things like:
+- request chat logs up to a certain point
+- connect to a specific room
+- connect/disconnect messages
+
+- The null terminator must be sent with the string.
+- The text can be arbitrary length
+- [ ] use char text[]; instead of char*
+
+- todo: compression?
+
+## Arena's
+1. There is an arena for the messages' texts (`msgTextArena`) and an arena for the messages
+ (`msgsArena`).
+2. The `Message.text` pointer will point to a text buffer entry in `msgTextArena`
+3. Good way to do this, if you have message `M`.
+```c
+M.text = ArenaPush(msgTextArena, M.text_len);
+```
+Notice, that this depends on knowing the text's length before allocating the memory.
+