+ All Categories
Home > Documents > Java Mini Project Lan Chat

Java Mini Project Lan Chat

Date post: 09-Oct-2015
Category:
Upload: dakshayaa-deepankar
View: 220 times
Download: 13 times
Share this document with a friend
Description:
A LAN messenger is an instant messaging program designed for use within a single local area network (LAN).Many LAN messengers offer basic functionality for sending private messages, file transfer, chatrooms and graphical smileys. The advantage of using a simple LAN messenger over a normal instant messenger is that no active Internet connection or central server is required - and only people inside the firewall will have access to the system.
21
 L N Chat Server Made By :  Alisha R Gonsalves (12070121503) Dakshayaa Deepankar (12070121509)
Transcript

LAN Chat System

LAN Chat ServerMade By : Alisha R Gonsalves (12070121503) Dakshayaa Deepankar (12070121509)

AbstractOur Java project is based on the LAN chat server. During this project we covered the basics of using classes or features on:

Sockets : A socket is one end-point of a two-way communication link between two programs running on the network. Socket classes are used to represent the connection between a client program and a server program. The java.net package provides two classes--Socket and ServerSocket--that implement the client side of the connection and the server side of the connection, respectively.

Threads : One way to create a thread in java is to implement the RunnableInterfaceand then instantiate an object of the class. We need to override the run() method into the class which is the only method that needs to be implemented. The run() method contains the logic of the thread.

Swing : Swing is built on top of AWT and is entirely written in Java, using AWTs lightweight component support. In particular, unlike AWT, the architecture of Swing components makes it easy tocustomizeboth their appearance and behavior. Components from AWT and Swing can be mixed, allowing us to add Swing support to existing AWT-based programs. For example, swing components such as JSlider, JButton and JCheckbox could be used in the same program withstandardAWT labels, textfields and scrollbars.

INTRODUCTION Common mode of communication CELLULAR PHONES High service rates Not ECONOMICAL!!!.

SOLUTION ????

LAN CHAT SERVER!!!FEATURESChattingVoice Chat(can be implemented)File Transfer(can be implemented)Bulletin BoardDisplay of friend list

USE CASE DIAGRAM

CONTEXT DIAGRAM

DATA FLOW DIAGRAM

E R DIAGRAM

Networking (java.net)Thejava.netpackage provides two classes--Socket and ServerSocket--that implement the client side of the connection and the server side of the connection, respectively.Network SocketAllows a single computer to serve many client at onceAs well as serving different information alsoThis is managed by portPort Numbered socket on a particular machineMultiple client can connect on same portImaginary pointsTCP/IP reserves the lower 1024 ports 21 for FTP,23 for Telnet, 25 for email, 80 for HTTPSocket Basics

A socket is one end-point of a two-way communication link between two programs running on the network. Socket classes are used to represent the connection between a client program and a server program

A socket is a connection between two hosts. It can perform seven basic operations: Connect to a remote machine Send data Receive data Close a connection Bind to a port Listen for incoming data Accept connections from remote machines on the bound portClient vs. ServerTraditional definition- Client: user of Network Services- Server: Supplier of Network Services

Analogy: Company phone lineInstalling phone is like starting serverExtension is like portPerson who calls is the client : he specifies both host(general company number) & port(extension)

WORKING

Programming Basics Package: import java.net.*; import java.io.*;

Opening a socket requires a hostname(or IP Address) and Port NumberSocket client = new Socket( hostname ,port number);

The URL and URL Connection classes simplify communication with web servers

Programming Basics(contd..)Create an input Stream to read the response from serverBufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream( ));

Create an Output Stream that can be used to send info to the socketPrintWriter out = new PrintWriter(client.getOutputStream( ));out.println( Hi Dude!!);out.print(Howz life!!);

Close the socket when done client.close();

SERVER TO CLIENT COMMUNICATION CHANNEL

CLIENT TO SERVER COMMUNICATION CHANNEL USES :To efficiently communicate in aCompanyInstitutionHostel

LIMITATIONSDelay of 2-3 seconds in voice transferServer fails whole system fails

Server

Client 1

Client 2

FUTURE EXPECTSIntegration of video chat using web cam.

Making it more secure.

Recovery management system.

THANK YOU!21


Recommended