4. Contents
Introduction.
- About Chat Application.
- About Tcp , Client , Server , Port &
Port & Socket.
Implementation
- Basic Diagram Of Chat
Application.
- Process Of Multiuser Chat
Application.
- Implementation using Java Socket
Socket Programming.
7. 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.
8. 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.
9. 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.
10. About Port
In computer networking, a port represents a communication
channel or endpoint. A port can be either physical or
virtual.
13. Process Of Multi-User Chat Application
Chat “Client1” Chat “Server”
port (9001)
Ip (10.0.0.1)
Chat “Client2”
Wait For
Another Client
14. 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();
15. Continued….
Create an Output Stream
PrintWriter out = new PrintWriter
(client.getOutputStream( ));
Close the socket when done
client.close();
18. 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.
19. Future Plan
Integration of video chat using web cam.
Making it more secure.
Recovery management system.