This project serves as a practical exploration of TCP socket programming. Uses POSIX 'sys/socket.h', therefore works only on Posix systems.
The recent implementation is housed in the chat/
directory, with an older version (old_implementation
) retained for reference. A key distinction is that the earlier iteration employed fixed-size data, while the current implementation dynamically handles data size.
The server operates by first receiving the data size (recv/read) and subsequently obtaining the data itself. Ultimately, the server broadcasts the received message to all connected clients.
The client functionality is separated into two threads. The first thread manages the Text User Interface (TUI) and handles message transmission (send/write), while the second thread receives broadcasted messages (recv/read) and stores them in an array.
- ncurses (for TUI)
- The base example was sourced from GitHub - TCP Client-Server in C
- Article on How TCP Sockets Work
- Book: UNIX Network Programming
- Length Prefix Framing: Length Prefix Framing for Protocol Buffers
- TUI Insights: How to make TUI
- UTF-8 encoding
- Raygui Support
- Windows support for server