This is a terminal-based chatting application built in C using the socket.h
library. It allows multiple clients to connect to a single server for real-time messaging.
- Simple and lightweight terminal-based chat interface.
- Multi-client support through a single server.
- Built using C and the
socket.h
library for efficient network communication.
Ensure you have the following installed:
- GCC compiler
make
utility- Linux operating system
-
Clean Previous Builds Run the following command to remove any existing compiled files:
make clean
-
Compile the Program Build the server and client executables with:
make compile
One user needs to start the server. Use the following command to launch it:
./obj/tcp_server
The server will display its IP address and port. Share these details with anyone who wants to connect.
On a new terminal, clients can connect to the server using:
./obj/tcp_client <ip_address> <port>
Replace <ip_address>
and <port>
with the details provided by the server.
Once connected, you can start chatting with your friends in real time!
-
Server Terminal:
./obj/tcp_server
Output:
Server is running on IP: 192.168.1.10, Port: 8080
-
Client Terminal:
./obj/tcp_client 192.168.1.10 8080
-
Chat Away! Begin sending messages back and forth between the connected terminals.
This project is open-source and available under the MIT License.
Feel free to use, modify, and distribute the application as per the terms of the license.
Contributions are welcome! If you find a bug or have a feature request, feel free to open an issue or submit a pull request.
Happy chatting!