An open API service indexing awesome lists of open source software.

https://github.com/mirzaim/java-chatroom

A simple chatroom application built using Java.
https://github.com/mirzaim/java-chatroom

chatroom client-se java sock

Last synced: 5 months ago
JSON representation

A simple chatroom application built using Java.

Awesome Lists containing this project

README

        

# Java Chatroom

A simple chatroom application built using Java. This project provides both the server and client implementations to facilitate real-time messaging between multiple clients over a network.

## Features

- Multi-client support
- Real-time message broadcasting
- Simple and modular code structure
- Separate client and server packages for clear organization
- Uses Java socket programming for communication

## Project Structure

```bash
src/
└── com/chatroom
├── client # Client-side implementation
├── message # Message handling and protocols
└── server # Server-side implementation
```

- **client**: Contains the classes necessary for the chatroom clients to connect to the server and send/receive messages.
- **message**: Defines the structure and handling of messages exchanged between the server and clients.
- **server**: Implements the server that manages client connections and broadcasts messages to all connected clients.

## How to Run

### Server

1. Navigate to the `src/com/chatroom/server` directory.
2. Compile the server code:
```bash
javac Server.java
```
3. Run the server:
```bash
java Server
```

### Client

1. Navigate to the `src/com/chatroom/client` directory.
2. Compile the client code:
```bash
javac Client.java
```
3. Run the client:
```bash
java Client
```
4. When prompted, enter the server's IP address and port number to connect.