A simple Java networking project that demonstrates real-time communication between a client and server using Socket Programming.
This project uses TCP sockets to establish a connection where the client sends messages to the server and the server responds back interactively through the terminal.
- Real-time client-server communication
- Java Socket Programming
- TCP/IP based connection
- Interactive terminal chat
- Beginner-friendly networking project
- Separate client and server implementation
- Java
- Socket Programming
- TCP/IP Networking
- BufferedReader
- PrintStream
βββ ChatServer.java
βββ ChatClient.java- The server starts and waits for incoming client connections on port
2100. - The client connects to the server using localhost.
- Messages are exchanged between the client and server through terminal input/output.
- Communication continues until the client enters
End.
Open terminal in the project folder and run:
javac ChatServer.java
javac ChatClient.javaRun:
java ChatServerYou will see:
Server Application Is Running...
Server Is Waiting At Port 2100Open another terminal window and run:
java ChatClientYou will see:
Client Application Is Running...
Connection Is Successful With The Server- Client sends message to server
- Server receives and replies
- Communication happens continuously
To stop communication, type:
EndThis project helps in understanding:
- Client-Server Architecture
- Java Networking
- Socket Communication
- Input/Output Streams
- TCP Protocol Basics
- GUI based chat application
- Multiple client support
- Message encryption
- File sharing
- Chat history storage
- User authentication
Ketan Lade