Skip to content

multi-threaded console TCP chat server supporting real-time concurrent messaging for multiple clients, with thread-safe operations and thread pooling.

Notifications You must be signed in to change notification settings

noobiedoobadoo/GroupChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

GroupChat

CLI based chat program where users can write and read messages

to start server

javac Server.java
java Server

similarly for client

javac Client.java
java Client

Enter username/alias , if it's already in use you're prompted again Screenshot 2024-10-29 210404

  • registering for a username/alias is atomic

In the below screenshot you can see that users can read & write connection is maintained until client decides to disconnect using /quit Screenshot 2024-10-29 203557

Implementation

  • Server listens for incoming connections
  • When a client connects new thread is spawned corresponding to that client
  • A list of all connected clients is maintained
  • If multiple clients register for same alias only 1 is allowed and rest are blocked (alias allocation is Atomic)
  • When a client sends a message, it is broadcasted to all connected clients
  • If a client disconnects the connection is removed from the list

About

multi-threaded console TCP chat server supporting real-time concurrent messaging for multiple clients, with thread-safe operations and thread pooling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages