Vous êtes sur la page 1sur 15

Page 1

CHAT APPLICATION










Page 2


INTRODUCTION

Teleconferencing or Chatting, is a method of using technology to bring
people and ideas together despite of the geographical barriers. The technology
has been available for years but the acceptance it was quit recent. Our project is
an example of a chat server. It is made up of 2 applications the client
application, which runs on the users Pc and server application, which runs on
any Pc on the network. To start chatting client should get connected to server
where they can practice two kinds of chatting, public one (message is
broadcasted to all connected users) and private one (between any 2 users only)
and during the last one security measures were taken.












Page 3



OBJECTIVES

Communication over a network is one field where this tool finds wide
ranging application. Chat application establishes a connection between 2 or
more systems connected over an intra-net or ad-hoc. This tool can be used for
large scale communication and conferencing in an organization or campus of
vast size, thus increasing the standard of co-operation. In addition it converts the
complex concept of sockets to a user friendly environment. This software can
have further potentials, such as file transfer and voice chatting options that can
be worked upon later.












Page 4



PROJECT CATEGOERY

SOCKET PROGRAMMING-JAVA
A socket is one of the most fundamental technologies of computer
networking. Sockets allow applications to communicate using standard
mechanisms built into network hardware and operating systems. Although
network software may seem to be a relatively new "Web" phenomenon, socket
technology actually has been employed for roughly two decades.
Sockets provide the communication mechanism between two computers
using TCP. A client program creates a socket on its end of the communication
and attempts to connect that socket to a server. When the connection is made,
the server creates a socket object on its end of the communication. The client
and server can now communicate by writing to and reading from the socket.
The java.net. Socket class represents a socket, and the java.net. Server Socket
class provides a mechanism for the server program to listen for clients and
establish connections with them.









Page 5


SYSTEM ANALYSIS
DFD(DATA FLOW DIAGRAM)

















CHAT SERVER
SENDS MESSAGES SENDS MESSAGES
REQUEST
LOGIN
MONITOR
RECIEVES
MESSAGES
MESSAGES VALIDATE USER
RECIVES MESSAGE
ACCESS DENIED/ACCESED
VALIDATE
USERID &
PASSWOR
SERVER
ADMIN
MONITORI
NG OF
DATABASE
SEND&RECEIV
E MESSAGE
USER
ACCESS GRANTED
DENIED
REQUEST FOR
LOGIN
SERVER
ADMIN

Page 6


E-R DIAGRAM










EXPLANATION OF PROGRAMMING
Client Server Communication
The server is bound to a fixed socket and listens for connection requests from clients.
The clients try to connect to server on this port and predefined host. Once the
communication channels are set up, both talk in terms of objects defined as protocols.
Upon receiving these objects the program then extracts relevant information and takes
appropriate actions. All communications are through server and may change the protocol
parameters if required.
Protocols
Self designed protocols have been defined to enable communications between server
and clients. Protocols have primarily been defined as classed which have required parameters.
The objects of these classes are then exchanged

Message Protocol
Message
Message_ID
Mesag_recieve_ID
Subject
Message_Text
Attachments_Id
Has_one_o
r_many
Message_reciver
Mesag_recievr_ID
Message_ID
Reciver_ID

Page 7


This defines how messages are to be handled between users and server. The
user can send public and private message. For private message it is important
to know the recipient and the sender of the message.

Fields
Audience public or private message
RoomNumber Currently of no use. In future can be used for multiple
rooms
RecieverId Id of the recipient. Useful only for private messages
SenderId Id of sender. Useful only for private messages
Message Text that the user wants to send
Client Information Protocol
This is meant to exchange client information between user and server.
When a new client connects to the server its relevant information is kept in
an object of this class. Other users are notified of arrival of new client using
information from this protocol.
Fields
ClientId Identification number of client within the server.
ClientName The login name provided by the user.

Chat Request Protocol
This protocol is used to notify a client that another client wants to start a
private chat with it. A message of this type must be sent before any private
conversation can start. This message is sent when user chooses to start a
private conversation. Upon receiving this request the recipient's client
takes steps to receive private messages from the server by the specified
sender.
Fields
SenderId The clientId of the client machine that initiated the request.

Page 8


RecieverId The clientId of the client machine that is to be notified.

Update Client List Protocol
When a new user logs in to the server all clients have to be notified of this
arrival. Also when a user logs out, all users must be notified. This
protocol is used to simplify this process. A message of this type with the
new clients name is broadcast to all client machines.
Fields
Request Type Indicates if the user has to be added or removed
ClientName The name of the client that the information is about

Log Out Protocol
When a user chooses to logout of the system the server and all other users
must be notified. Upon users choice the local client machine sends a
message of this type to the server. Upon receiving this message the server
forwards it to all clients. Then breaks connection with the client.
Join Chat Room Protocol
This protocol is reserved for when multiple chart rooms will be
implemented.
Fields
Request Type -- Indicates if the user has to be added or removed
Room Number RoomId of the room that the user wants to join

Connection Notice Protocol
If the server rejects the connection then this object is sent to the client. The
reason might be over occupied server or clients nick already in use.


Page 9













Page
10


MODULES OF PROJECT

1. CHAT SERVER:

The interface has been developed in Swing. Interface has been
kept separate from the network processes. The main components of the
server interface are as follows:
1. Messages Area: Connection acceptance , rejection, login
messages are shown here.
2. List of Online Users: On the right side of the message window
is the list of users that are connected to the server currently.
A user can be selected from this list by clicking on name.
3. Configure Server Dialog: This dialog is shown when option is
selected from the menu. This dialog will allow new values and
saving to configuration file.
4. Main Menu: The options available for the server . The
options includes the configure server, shutdown server

2. CHAT CLIENT:

The interface has been developed in Swing. Interface has been
kept separate from the network processes. The main components of the
client interface are as follows

1. Message Tabs: These are the conversation tabs. All
conversation windows are kept within these tabs.
2. Message Entry Field: This is place at the bottom of the
window. This is where the user enters whatever message
he/she wants to send. Message is sent by either pressing enter
or pressing the send button. Where the message is sent depends
on which tab is open.
3. Online User List: This list shows all the users who are logged
in at the server. Double clicking on a user will open a
+conversation window with him .
4. Configure Dialog: This dialog is shown when option is
selected from the menu. This dialog will allow new values and
Page
11


saving to configuration file. You can change server host name
and port.
5. Main Menu: The options available for the server. The options
include connect, disconnect, configure, exit, close current tab,
close all tabs, help.

















Page
12


TESTING
Si.No Description Test Steps Expected Result
login_001 Verify that user
should be able to
login to the system.
Invoke application

Login page should
be displayed with
the following
details
a)userid-text box
b)password text
box
c)login-button
d) Sign-up link
Enter username and
password in login page
and
click login button

For the valid user
the chat page of
corresponding user
should be
displayed to the
user.
Enter username and null
password
A message should
be displayed to
user entered
password
Null username and
password
A message should
display Please
enter the Fields.





Enter invalid username
and password.

Error page should
be displayed and
prompts user to re-
login.

Page
13


Enter correct username
and incorrect password.
A message invalid
password should
be displayed to
user.

02.Sending
/ Receiving
message
Sender:
Type the message
in text box, select
recipient and click
send button.
Null message A message that
displays please
Enter a message
Enter message and no
recipient.
A message that
displays Please
enter recipient
Enter message and
recipient address
A message that
displays Message
Sent.
Receiver:
Receive message
from sender.
Send a message to
receiver.
Display the
message in inbox
side.







Page
14


SOFTWARE AND HARDWARE REQUIREMENTS



SOFTWARE REQUIREMENTS
Operating System : Windows 7
Front End : Java
Editor : Netbeans



HARDWARE REQUIREMENTS
Processor : Intel Pentium or Above
Ram : 512 MB or Above
Hard Disc : 40 GB or Above









Page
15


FUTURE ENHANCEMENT & SCOPE

1. Login session information: We can include a feature in this application
that will keep a record of the users login session.

2. Offline messages: User can send messages to friends even when they are
offline.

3. File transferring and sharing: User can transfer one or more files to other
users. A file can also be shared between two or more users.

4. Profile Database: The profile information of every user can be stored at
the server.

5. Login Timeout: This feature allows the user to be logged in only for a
specific time. After this time span ends, the user is automatically logged
out.

Vous aimerez peut-être aussi