Chat CLI is a simple command-line chat application built in C using sockets and pthreads. It supports multiple clients connected to a server, allowing real-time message broadcasting to all connected users.
- TCP-based IPv4 communication
- Multi-client support via threads
- Message broadcasting to all clients
- Command-line interface
- The server listens for incoming connections.
- Each connected client is handled on a separate thread.
- Messages sent by one client are broadcast to all others.
- Typing
byecloses the client connection.
Make sure you have GCC installed.
gcc server.c -o server -lpthread
gcc client.c -o client -lpthreadMake sure you have CMake 3.10 or above:
mkdir build
cd build
cmake ..
makeThis will generate two executables in the build/ directory: server and client.
./server./client.
├── client.c # Client source code
├── server.c # Server source code
├── CMakeLists.txt # CMake build configuration
├── README.md # This file