ChatBuzz is a simple online chat application developed using Java. It allows multiple users to connect to a central server, send messages, and receive messages from other users. This project assesses skills in socket programming, client-server communication, and user interface design.
- Java Development Kit (JDK) installed on your machine.
- A terminal or command prompt for running the application.
- Open a terminal or command prompt.
- Navigate to the directory containing the
ChatServer.java
file. - Compile the server code using the following command:
javac server/ChatServer.java
- Run the server using the following command:
java server.ChatServer
- Open a terminal or command prompt.
- Navigate to the directory containing the
ChatClient.java
file. - Compile the client code using the following command:
javac client/ChatClient.java
- Run the client using the following command:
java client.ChatClient
- Repeat steps 1-4 in separate terminal or command prompt windows to simulate multiple clients.
The application consists of two main components:
- Server (
ChatServer
): Manages connections from multiple clients and broadcasts messages to all connected clients. - Client (
ChatClient
): Connects to the server, sends messages to the server, and receives messages from other clients.
- The server runs on
127.0.0.1
and listens on port12345
. - The client connects to the server using the same IP and port.
- After starting the server, open multiple clients.
- Type messages in one client and press Enter to send the message.
- Messages will be broadcasted to all connected clients.
- Close a client window to simulate client disconnection.