This is a simple terminal-based chat application built with Java using TCP sockets. It allows multiple clients to connect to a central server and chat with each other in real-time.
Server.java– Accepts clients, handles each one in a separate thread, and broadcasts messages to all connected clients.Client.java– Connects to the server, sends messages typed by the user, and displays messages received from other clients.
- Real-time message broadcasting to all connected clients
- Parallel handling of multiple clients using threads
- Username-based message identification
- Graceful client disconnection using "quit"
javac Server.java Client.javajava ServerBy default, it listens on port 7777.
java ClientYou will be prompted to enter:
- Username
- Server IP (e.g.,
localhost) - Server port (e.g.,
7777)
- Java SE
- TCP Sockets (java.net.Socket, ServerSocket)
- Multithreading (Thread class)
- Stream I/O (BufferedReader, PrintWriter)
This project was implemented as part of a distributed systems TP (travaux pratiques).
