Sei sulla pagina 1di 15

1

-: Project Documentation :-

Online Chat Server

Submitted to :- Project Members :-


Er. AMIT GUPTA Avinish Kr. Dubey
Shivam Awasthi
Onkar Mudgal
2
3

CONTENTS

1. PROBLEM STATEMENT

2. SOFTWARE REQUIREMENTS

3. HARDWARE REQUIREMENTS

4. EXPLANATION OF MODULES

5. PROGRAMMING

6. CONSTRAINTS

7. FUTURE ASPECTS

8. BIBLIOGRAPHY
4

PROBLEM
STATEMENT
Quick messenger is a simulation of the instant messenger which we
have established within a LAN. Instant messaging represents a
medium via which messaging partners can interact in a synchronous
fashion. Correspondence can occur in a near "instant" manner. With
quick messenger we are providing an easy to use and a rich graphical
user interface.

It is basically a server-client model in which server side program is


used to save the details of the users.

There is a central server handling all communications to and from clients. Each user can
run the client program and connect to server to start chatting. All clients and server will
have list of online users. List is updated as soon as the status of some client changes.
There is one main chat room in which all messages can be seen by all clients.

The user can send instant messages to other clients that are online at
that instant using the
“send” option.

Users can also choose to chat in private with any one on the list.

Multiple chat rooms have not been implemented but provisions are provided in code for
easy deployment.

To end the session the user has to exit the network by using the
“disconnect” option.

SOFTWARE
REQUIREMENTS

• Minimum Microsoft Windows’98 operating system


• Netbeans5.5 Beta2 IDE
• JDK 1.6
5

Java 2 Platform Standard Edition 6.0


TM

JRE and JDK

Sun Microsystems provides two principal software products in the Java 2 Platform
TM

Standard Edition (J2SE ) family:


TM

J2SE Runtime Environment (JRE)

The JRE provides the libraries, Java virtual machine, and other components necessary for
you to run applets and applications written in the Java programming language. This
runtime environment can be redistributed with applications to make them free-standing.

J2SE Development Kit (JDK)

The JDK includes the JRE plus command-line development tools such as compilers and
debuggers that are necessary or useful for developing applets and applications.

Java Programming Language

The Java Programming Language is a general-purpose, concurrent, strongly typed, class-


based object-oriented language. It is normally compiled to the bytecode instruction set
and binary format defined in the Java Virtual Machine Specification..

Java Virtual Machines

The Java virtual machine is an abstract computing machine that has an instruction set and
manipulates memory at run time. The Java virtual machine is ported to different
platforms to provide hardware- and operating system-independence.

The Java 2 Platform Standard Edition provides two implementations of the


Java virtual machine (VM):

Java HotSpot Client VM

The client VM is an implementation for platforms typically used for client


applications. The client VM is tuned for reducing start-up time and memory
6

footprint. It can be invoked by using the -client command-line option when


launching an application.

Java HotSpot Server VM

The server VM is an implementation designed for maximum program execution


speed, trading off launch time and memory. It can be invoked by using the
-server command-line option when launching an application.

Base Libraries

Classes and interfaces that provide basic features and fundamental functionality
for the Java platform.

Lang and Util Packages

Provides the fundamental Object and Class classes, wrapper classes for
primitive types, a basic math class, and more.

Other Base Packages:

I/O

I/O functionality provides for system input and output through data streams,
serialization and the file system. In 1.4, a new I/O (NIO) API was introduced that
provides new features and improved performance.

Networking

Provides classes for networking functionality, including addressing, classes for


using URLs and URIs, socket classes for connecting to servers, networking
security functionality, and more.

Integration Library Used

Java Database Connectivity (JDBC) API

The JDBC API provides universal data access from the Java programming
TM

language. Using the JDBC 3.0 API, you developers can write applications that
7

can access virtually any data source, from relational databases to spreadsheets and
flat files. JDBC technology also provides a common base on which tools and
alternate interfaces can be built..

User Interface Libraries :

Image I/O

The Java Image I/O API provides a pluggable architecture for working with
images stored in files and accessed across the network. The API provides
provides a framework for the addition of format-specific plugins. Plug-ins for
several common formats are included with Java Image I/O, but third parties can
use this API to create their own plugins to handle special formats.

AWT

The Java platform's Abstract Windowing Toolkit (AWT) provides APIs for
TM

constructing user interface components such as menus, buttons, text fields, dialog
boxes, checkboxes, and for handling user input through those components. In
addition, AWT allows for rendering of simple shapes such as ovals and polygons
and enables developers to control the user-interface layout and fonts used by their
applications..

Swing

The Swing APIs also provide graphical component (GUI) for use in user
interfaces. The Swing APIs are written in the Java programming language without
any reliance on code that is specific to the GUI facilities provided by underlying
operating system. This allows the Swing GUI components to have a "pluggable"
look-and-feel that can be switched while an application is running.

Tool Specifications:

Debugger Architecture

Architecture and specifications for use by debuggers in development


environments..

VM Tool Interface
8

The Java Virtual Machine Tool Interface (JVM TI) is a specification for
inspecting the state and controlling the execution of applications running in the
JVM. The Java Virtual Machine Profiler Interface (JVMPI) has been deprecated..

Javadoc Tool

Javadoc is a tool that parses the declarations and documentation comments source
files to produce a set of HTML pages describing the program elements. The
Doclet API provides a mechanism for clients to inspect the source-level structure
of programs and libraries, including javadoc comments embedded in the source.
This API can be used by doclets to generate documentation.

JDK Tools & Utilities

Documentation for the tools and utilities included in the JDK. Covers basic tools
(javac, java, javadoc, apt, appletviewer, jar, jdb, javah, javap, extcheck), security
tools, internationalization tools, RMI tools, IDL and RMI-IIOP tools, deployment
tools, Java Plug-in tools, and Java Web Start tools, monitoring and management
tools, and troubleshooting tools.

Platforms

Sun provides implementations of the JDK and Java Runtime Environment for
Microsoft Windows, Linux, and the Solaris operating systems.

HARDWARE REQUIREMENTS
PROCESSOR: Intel Pentium2 onwards, Asus, Apple
RAM: 128MB onwards
Local Area Network should
Explanation Module :-
9

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.
10

4. Main Menu: The options available for the server. The options
include 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 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

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
11

Message Protocol
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.
• 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
12

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.

There are no fields

Shut Down Protocol


If the server has to be shut down it must notify the clients. This message is
broadcast to all clients that they must close their connections.

There are no fields

Join Chat Room Protocol


This protocol is reserved for when multiple char 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

Kicked Out Notice Protocol


If the administrator chooses to kick out a user the server must send this
message to the kicked out client. The client is told out of which room the
user has been kicked out of. If the user is kicked out of the main room it is
equivalent of a forced log out.

Fields
• RoomNumber – Indicates which room the user has been kicked
out of

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.
Fields
• Status – indicates whether the connection was accepted or rejected by
the server.

CONSTRAINTS
1. This application can be implemented only on a LAN and not on
the INTERNET.
13

2. It is implemented using JDK1.5 but may or may not be


implemented with JDK1.6.

3. This application is NETBEANS IDE based. It requires prior


installation of NETBEANS 5.5 Beta 2 version.

4. The user can send messages only to the friends who are offline.

5. There can be only one user per PC.

FUTURE ASPECTS

The primary application of a messenger is to communicate with people.


A messenger is useful in the following ways for communication:

1. The user can communicate with many people simultaneously.


2. The user can transfer files to others.
3. Files can also be shared between two or more users.

Communication plays a pivotal role in any organization, whether it is a


business organization, an educational institution or industry. Besides
telephone, emails etc a messenger can be used as an effective and faster
means of communication. The people in the organization can have a meeting
session using the conferencing facility in the messenger. Files can be
transferred at a much faster rate using the messenger than they can be done
manually.
Besides this it can also be used as a medium for entertainment. For e.g for
chatting with friends, conferencing etc.

FUTURE ENHANCEMENTS:

1. Login session information: We can include a feature in this


application that will keep a record of the user’s login session.

2. Offline messages: User can send messages to friends even


when they are offline.
14

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.

BIBLIOGRAPHY

1. The Complete Reference JAVA 2 fifth edition

2. Java Cookbook (e-book)

3. JDK 1.6 Documentation


15

Potrebbero piacerti anche