The Chat Room Project is a simple client-server application written in C that allows multiple users to connect and communicate in real-time via the terminal. It demonstrates core networking concepts such as sockets, multithreading, and TCP communication.
- Multiple clients can connect to a single server
- Real-time text messaging between clients
- Server broadcasts messages to all connected clients
- Basic command-line interface
- C Programming Language
- POSIX Sockets (TCP)
- Threads (POSIX pthread)
chat-room/
│
├── src/
│ ├── server.c # Server-side logic
│ ├── client.c # Client-side logic
│ └── common.h # Shared constants & function declarations
│
├── Makefile # For building server and client
└── README.md # Project documentation
gcc src/server.c -o server -lpthread
gcc src/client.c -o client -lpthread./server./client- Start the server first by running
./server - Connect clients by running
./clientin separate terminal windows - Type messages and press Enter to send them to all connected clients
- Use
Ctrl+Cto disconnect clients or stop the server
- GCC compiler
- POSIX-compatible system (Linux, macOS, WSL)
- pthread library support
- User authentication and nicknames
- Private messaging between specific users
- Message history and logging
- GUI interface
- File sharing capabilities