This is a mini-project demonstrating client-server communication using Java. The project allows a client and a server to communicate with each other via the command-line interface (CMD). The server listens for client requests, and the client can send messages to the server. The server responds accordingly, allowing for two-way communication.
- Client-Server Communication: The client can send messages to the server, and the server responds.
- Command-Line Interface: Interaction happens through the CMD terminal.
- Socket Programming: The project is built using Java's
SocketandServerSocketclasses for network communication. - Simple Protocol: A basic text-based protocol for sending and receiving messages between client and server.
- The server is started and listens on a specific port for incoming connections from clients.
- The client connects to the server via the specified IP address and port.
- The client can send messages to the server.
- The server processes the messages and responds to the client.
- Communication continues until the client or server terminates the connection.
- Java: Make sure you have Java installed. You can check by running:
java -version
- Clone the repository to your local machine:
git clone https://github.com/raghavg2004/Java-Client-Server-Communication.git
- Compile the Java Files: Open a terminal and navigate to the project directory. Compile the server and client Java files:
javac Server.java javac Client.java - Run the Server: In the terminal, start the server:
java Server - Run the Client: Open another terminal window and start the client:
java Client - Test the Communication: You can now send messages from the client to the server via CMD. The server will process the messages and respond.
This project is licensed under the MIT License - see the LICENSE file for details.