Lan chat system

21
LAN Chat server BY: VIPUL GUPTA VIKESH SINGH SUKHDEEP SINGH

description

Basics of LAN CHAT IMPLEMENTATION in java

Transcript of Lan chat system

Page 1: Lan chat system

LAN Chat server

BY: VIPUL GUPTA VIKESH SINGH SUKHDEEP SINGH

Page 2: Lan chat system

INTRODUCTION

• Common mode of communication –• “CELLULAR PHONES”• High service rates – Not ECONOMICAL!!!.

SOLUTION ????

• LAN CHAT SERVER

Page 3: Lan chat system

FEATURES

• Chatting

• Voice Chat

• File Transfer

• Bulletin Board

• Display of friend list

Page 4: Lan chat system

USE CASE DIAGRAM

 •

•  

•  

•  

•  

•  

• • •  •  •  •

Page 5: Lan chat system

CONTEXT DIAGRAM

Page 6: Lan chat system

DATA FLOW DIAGRAM

Page 7: Lan chat system
Page 8: Lan chat system

Networking (java.net)

• Network Socket• Allows a single computer to serve many client at

once• As well as serving different information also• This is managed by port

• Port • Numbered socket on a particular machine• Multiple client can connect on same port• Imaginary points• TCP/IP reserves the lower 1024 ports • 21 for FTP,23 for Telnet, 25 for email, 80 for HTTP

Page 9: Lan chat system

Socket Basics

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 port

Page 10: Lan chat system

Client vs. Server

Traditional definition

- Client: user of Network Services

- Server: Supplier of Network Services

Analogy: Company phone line- Installing phone is like starting server- Extension is like port- Person who calls is the client : he specifies both

host(general company number) & port(extension)

Page 11: Lan chat system
Page 12: Lan chat system

Working :

• Formation of socket to make a connection with the server

• Server will forward the request to specific client by making a socket connection with client

• For voice transfer client side data will be stored in rm format for 2-3 seconds

• Then it will be forwarded towards receiving client where it will be played

• This process of voice transfer will continue in a loop

• Using streams we can transfer any type of data

Page 13: Lan chat system

WORKING

Page 14: Lan chat system

Programming Basics

• Package: import java.net.*;• import java.io.*;

• Opening a socket requires a hostname(or IP Address) and Port Number

Socket client = new Socket(“ hostname “,port number);

• The URL and URL Connection classes simplify

communication with web servers

Page 15: Lan chat system

Programming Basics(contd..)• Create an input Stream to read the response from server

BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream( ));

Create an Output Stream that can be used to send info to the socket

PrintWriter out = new PrintWriter(client.getOutputStream( ));• out.println(“ Hi Dude!!”);

• out.print(“Howz life!!”);

• Close the socket when done

client.close();

Page 16: Lan chat system

SERVER TO CLIENT COMMUNICATION CHANNEL

CLIENT TO SERVER COMMUNICATION CHANNEL

Page 17: Lan chat system
Page 18: Lan chat system
Page 19: Lan chat system

USES :

To efficiently communicate in a

1. Company

2. Institution

3. Hostel

LIMITATIONS• Delay of 2-3 seconds in voice transfer• Server fails whole system fails

Page 20: Lan chat system

FUTURE EXPECTS

1. Integration of video chat using web cam.

2. Making it more secure.

3. Recovery management system.

Page 21: Lan chat system

THANKS……

QUERIES?????