Skip to content

Its-PrashantTechie/Chat-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Client-Server Chat Application

A desktop-based client-server chat application built using Java Socket Programming. The project demonstrates TCP/IP communication between a single client and a single server with a simple Swing-based graphical interface.

Features

  • Real-time messaging between a client and a server.
  • TCP/IP communication using Java Sockets.
  • Concurrent message handling using a dedicated thread for receiving messages.
  • Desktop GUI built with Java Swing.
  • Graceful connection termination using the end command.

Technologies Used

  • Java
  • Socket Programming (TCP/IP)
  • Java Swing
  • Multithreading
  • BufferedReader & PrintWriter

How It Works

  1. Start the server application.
  2. The server waits for a client connection on port 7777.
  3. Start the client application.
  4. Once connected, both users can exchange messages through the GUI.
  5. Typing end closes the connection.

Project Structure

.
├── Client.java
├── Server.java
└── ChatLogo.png

Concepts Demonstrated

  • Client-Server Architecture
  • TCP Socket Programming
  • Concurrent Message Handling using Threads
  • Java Swing GUI
  • Event Handling
  • Object-Oriented Programming

How to Run

1. Compile

javac Server.java
javac Client.java

2. Run the Server

java Server

3. Run the Client

java Client

The client will connect to the server running on localhost:7777.

Current Limitations

  • Supports only one client at a time.
  • Messages are exchanged only between one client and one server.
  • No user authentication.
  • No chat history or message persistence.
  • Works only over a local network unless the IP address and port are configured appropriately.

Future Improvements

  • Support multiple clients simultaneously.
  • Add usernames and user authentication.
  • Encrypt communication using SSL/TLS.
  • Store chat history in a database.
  • Implement file sharing.
  • Add emojis and timestamps.
  • Improve the user interface.

Learning Outcomes

This project helped me understand:

  • Java Socket Programming
  • TCP/IP communication
  • Thread-based concurrent message handling
  • Java Swing event handling
  • Client-server architecture
  • Integrating networking logic with a desktop GUI

Acknowledgement

The core networking and multithreading logic for this project was implemented by me. The Swing GUI layout was created with the assistance of AI and integrated with the networking code.

About

This is a chat application and is built using Socket Programming concepts .

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages