0% found this document useful (0 votes)
95 views

Systems Lab - Chat App

The document describes a multi-user chat application built using Java and the java.net package for networking. The chat application allows multiple clients to connect to a chat server and send messages to each other in real-time. The chat server broadcasts messages from connected clients to all other connected clients. Each client connects to the server, submits a unique screen name, and can then send and receive messages from other clients via the server.

Uploaded by

Abhishek Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views

Systems Lab - Chat App

The document describes a multi-user chat application built using Java and the java.net package for networking. The chat application allows multiple clients to connect to a chat server and send messages to each other in real-time. The chat server broadcasts messages from connected clients to all other connected clients. Each client connects to the server, submits a unique screen name, and can then send and receive messages from other clients via the server.

Uploaded by

Abhishek Agarwal
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MULTI USER CHAT

APPLICATION
A B H I S H E K AG A RWA L
B I S H WA S C G U P TA
S H U B H A M AG A RWA L

WHAT IS CHATTING?
Online chat may refer to any kind of communication over the Internet that
offers a real-time transmission of text messages from sender to receiver.
Chat messages are generally short in order to enable other participants to
respond quickly. Thereby, a feeling similar to a spoken conversation is
created, which distinguishes chatting from other text-based online
communication forms such as Internet forums and email.
Online chat may address point-to-point communications as well as multicast
communications from one sender to many receivers and voice and video chat
, or may be a feature of a web conferencing service.

THE PROJECT
In the project we have built a chat application using JAVA using the java.net
package for networking. It is like a chat room application (or like a whatsapp
group) where the messages of one user are broadcasted to other connected
users
It has two parts:
Chat Client
Chat Server

CHAT SERVER
Is a multi-threaded chat room server.
When a client connects the server requests a screen name by sending the
client the text "SUBMIT NAME", and keeps requesting a name until a unique
one is received.
After a client submits a unique name, the server acknowledges with "NAME
ACCEPTED".
Then all messages from that client will be broadcast to all other clients that
have submitted a unique screen name.
The broadcast messages are prefixed with "MESSAGE ".

CHAT CLIENT
Is a simple Swing-based client for the chat server.
Graphically it is a frame with a text field for entering messages and a text area to
see the whole dialog.
The client follows the Chat Protocol which is as follows:
When the server sends "SUBMITNAME" the client replies with the desired screen name.
The server will keep sending "SUBMITNAME" requests as long as the client submits
screen names that are already in use.
When the server sends a line beginning with "NAMEACCEPTED" the client is now
allowed to start sending the server arbitrary strings to be broadcast to all chatters
connected to the server.
When the server sends a line beginning with "MESSAGE " then all characters following
this string should be displayed in its message area.

THE APPLICATION AT WORK

CODE &
DEMONSTRATION

References
https://en.wikipedia.org/wiki/Online_chat
http://www.tutorialspoint.com/javaexamples/java_simple_gui.htm
http://www.tutorialspoint.com/java/java_networking.htm
Computer Networking: A Top-Down Approach by James F. Kurose and Keith W.
Ross

THANK YOU!

You might also like