Skip to content

A multithreaded client-server architecture based Chat Application using Java Socket programming. A server continuously listens for connection requests from clients across the network or even from the same machine. Clients connect to the server using an IP address and port number. The client needs to provide a unique username while connecting to …

License

Notifications You must be signed in to change notification settings

aditya30394/Geeky-Whatsapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geeky-Whatsapp

A multithreaded client-server architecture based Chat Application using Java Socket programming. A server continuously listens for connection requests from clients across the network or even from the same machine. Clients connect to the server using an IP address and port number. The client needs to provide a unique username while connecting to the server. This username is treated as the unique identifier for that client.

All the messages from the client are sent to the server using ObjectOutputStream in java. After receiving the message from the client, the server broadcasts the message if it is not a private message. And if it is a private message, which is detected using ‘@’ followed by a valid username, sends the message only to that user.

All the messages sent from various clients can be seen on the server console.

Instructions

To compile the Programs

javac ChatServer.java
javac ChatClient.java

Server

To start the server

java ChatServer
java ChatServer [portNumber]

If the port number is not specified, port 5000 is used by default

Starting the Chat Server

Client

To start the Client in console mode use one of the following command

java ChatClient username
java ChatClient username portNumber
java ChatClient username portNumber serverAddress

At the console prompt

  • If the portNumber is not specified 5000 is used
  • If the serverAddress is not specified "localHost" is used

Starting the Chat Client

Chat

On the client console:

  1. Simply type the message to send broadcast to all the active users
  2. Type '@usernameyourmessage' without quotes to send message to desired client
  3. Type 'GETUSERS' without quotes to see list of active clients
  4. Type 'SIGNOUT' without quotes to logoff from server

Screenshots

In the screenshots below, three clents namely "Aditya", "Abhishek" and "Himanshu" are active on the chat server.

Console of the Chat Server

Console of user Aditya

Console of user Abhishek

Console of user Himanshu

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A multithreaded client-server architecture based Chat Application using Java Socket programming. A server continuously listens for connection requests from clients across the network or even from the same machine. Clients connect to the server using an IP address and port number. The client needs to provide a unique username while connecting to …

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages