diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-31 00:32:07 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-11-03 00:58:07 +0100 |
commit | b9aeccef208d6d5b7d40b71886981723f1e14b95 (patch) | |
tree | 0312eeeb23f17bd6ba7861c112a382a10207eda9 /README.md | |
parent | 48733b6acfa27af8e030d9b7abfb9109b1ce89e0 (diff) |
Added ID system with 1 and 2-way communication
Each client now has an ID that is permanently stored to ID_FILE
location. To implement this each client now uses two connections to the
server, one for bidirectional communication and one for unidirectional
communication. This makes it easier to not receive unexpected message.
Also each client and server now has a Client struct that represents a
client and a clientsArena associated with it.
Minor changes:
- Added logging to LOGFILE, that can be turned with LOGGING macro.
- Added more error types
- Added error handling on server
- Added error messages
- Added convenience functions
- Added disconnectAndNotify() function for convenience
- Use recvTextMessageResult as multiple-value-return-type instead of **
- Separated protocol stuff into protocol.h
- Added Result types when wanting to return multiple values
- Do not allocate arena's with malloc
- Added recvAnyMessageType for receiving messages that do not need to
be stored
- Add UNIFD and BIFD file descriptors for separating requests
chatty.c:
- Convert ID to string in screen_home()
- Removed the fds global variable
- Pass fds to threadReconnect
- Implement faster sleep with nanosleep(2)
- Close file descriptors when failed so we do not have too many file
descriptors open
server.c:
- Send presence messages on disconnect & connect
- renamed i to conn
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -15,19 +15,28 @@ The idea is the following: - [x] wrapping messages - [x] bug: when sending message after diconnect (serverfd?) - [x] Handle disconnection thiin a thread, the best way would be -- [ ] ctrl+z to suspend +- [x] Add limit_y to printf_wrap +- [x] id2string on clients +- [x] ctrl+z to suspend +- [ ] bug(tb_printf_wrap): text after pfx is wrapped one too soon ## server +- [x] import clients - [ ] check if when sending and the client is offline (due to connection loss) what happens - [ ] timeout on recv? - [ ] use threads to handle clients/ timeout when receiving because a client could theoretically stall the entire server. - [ ] do not crash on errors from clients - implement error message? + - timeout on recv with setsockopt ## common - [x] handle messages that are too large -- [ ] log messages to file (save history) +- [x] refactor i&self into conn +- [x] logging +- [x] Req|Inf connection per client +- [ ] bug: blocking after `Added pollfd`, after importing a client and then connecting with the + id/or without? After reconnection fails chatty blocks (remove sleep) - [ ] connect/disconnections messages - [ ] use IP address / domain - [ ] chat history |