TerminalTalk is a high-performance, multi-threaded TCP chat server and client application implemented in C++. It facilitates real-time communication between multiple users through a terminal-based interface.
TerminalTalk TCP Server leverages POSIX sockets and C++ threads to manage multiple concurrent client connections. It provides a robust architecture for message broadcasting and client-server interaction, making it an ideal project for understanding network programming and concurrency in a Unix-like environment.
- Multi-threaded Architecture: Handles multiple clients simultaneously using dedicated threads.
- Real-time Broadcasting: Messages sent by one client are instantly distributed to all other connected participants.
- Enhanced Terminal Interface: Utilizes ANSI color codes and stylized banners for an improved user experience.
- Connection Animations: Includes terminal-based loading animations during initialization and connection phases.
- Username Identification: Each participant is identified by a unique username.
- Lightweight and Efficient: Minimal overhead, using standard C++ and system-level socket APIs.
- Language: C++11 or higher
- Protocol: TCP/IP
- API: POSIX Sockets
- Threading: C++ Standard Thread Library
- OS Support: Linux, macOS, and other Unix-based systems
Ensure you have the following installed on your system:
- GNU Compiler Collection (g++)
- Make build automation tool
git clone https://github.com/suadatbiniqbal/TerminalTalk-TCP-Server.git
cd TerminalTalk-TCP-ServerThe project includes a comprehensive Makefile for easy compilation.
make allThis will generate two executable files: server and client.
First, initiate the server to listen for incoming connections:
./serverThe server will start listening on port 5555 by default.
In separate terminal windows, start as many clients as needed:
./clientUpon starting, each client will:
- Display a startup banner.
- Undergo a brief connection initialization animation.
- Prompt for a username.
- Establish a connection with the server.
Once connected, simply type your message and press Enter to broadcast it to all other users. To disconnect, type /quit or /exit.
server.cpp: Implementation of the multi-threaded TCP server.client.cpp: Implementation of the TCP client with an interactive interface.Makefile: Build instructions for the project.README.md: Project documentation.
This project is open-source and available under the MIT License.