Multiuser chat application using java

Post on 15-Apr-2017

693 views 64 download

transcript

Welcome to the PresentationCourse : Computer Network

American InternationalUniversity-Bangladesh

Presented by:1

GroupMembers

Name: Noman,Asif-AlID:14-27134-2

2Name: Md. Mahmudul HaqueID:14-27205-2

3Name: Beg , Md Safat AlamID:14-26469-2

Multi-user Chat-Application

Using Java Socket Programming

Contents Introduction. - About Chat Application. - About Tcp , Client , Server , Port &

Socket. Implementation - Basic Diagram Of Chat Application. - Process Of Multiuser Chat

Application. - Implementation using Java Socket

Programming. Conclusion. - Advantage & Disadvantage - Future plan.

INTRODUCTION OF MULTI-USER CHAT-APPLICATION

About Chat-Application

Chat-Application provide the process of talking to other people who are using the Internet at the same time you are.

About Tcp

Transmission Control Protocol is a standard that defines how to establish and maintain a network conversation via which application programs can exchange data. TCP works with the Internet Protocol (IP), which defines how computers send packets of data to each other.

About Client & Server A Client is a computer that request services from a server computer.

A Server is a computer that provides services to clients and controls access to hardware software and other resources.

About Socket

A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to.

About Port

In computer networking, a port represents a communication channel or endpoint. A port can be either physical or virtual. 

IMPLEMENTATION OF MULTI-USER CHAT-APPLICATION

Basic Diagram Of Chat Application

Process Of Multi-User Chat Application

Chat “Client1” Chat “Server” port (9001) Ip (10.0.0.1)

Ip , port (“10.0.0.1”,9000)Socket Creation Failed Ip , port (“10.0.0.1”,9001) Socket Created Successfully

Chat “Client2” Ip , port

(“10.0.0.1”,9001) Socket

Created Successfully

Wait For Another Client

Submit A name

Submit same name

as client1 Rejected

Submit unique name

Implementation In Java 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);

Create an input Stream & client name input

BufferedReader in = new BufferedReader ( new InputStreamReader(client.getInputStream( ) );Private String name = in.readline();

Continued….

Create an Output Stream PrintWriter out = new PrintWriter(client.getOutputStream( ));

Close the socket when done client.close();

Continued….

Server To Client Communication Channel

Client To Server Communication Channel

CONCLUSION OF MULTI-USER CHAT-APPLICATION

Advantage & Disadvantage

Advantage - User have to put unique name for chat. - Single user can’t start chatting.

Disadvantage - Can’t handle program crush. - If Server fails, whole system will fail.

Future Plan

Integration of video chat using web cam.

Making it more secure.

Recovery management system.

Any Question Please??