This is a sample project that demonstrates the creation of a simple Java chat application using socket communication. The project is divided into server and client components, allowing users to communicate in real-time.
- Clients and server communicate via TCP/IP sockets.
- Clients can connect to the server and exchange messages.
- Each message includes sender information, content, and timestamp.
src
├── server
│ ├── ChatServer.java
│ └── ServerMain.java
├── client
│ ├── ChatClient.java
│ └── ClientMain.java
└── utils
└── Message.java
-
Compile the server and client classes.
javac server/*.java javac client/*.java
-
Start the server.
java server.ServerMain
-
Start one or more clients.
java client.ClientMain
- Make sure the server is running before starting clients.
- Exchanged messages are displayed in the console.
- This is a sample project and can be extended with additional features and enhancements.
This project is licensed under the MIT License - see the LICENSE file for details.