-->

Tuesday, 13 February 2018

tcp chat client server program in java

TCP chat client server program in java

Image result for tcp chat client server program


Chat Program Java is a continuous communication between two systems. Networking chapter also (apart threads, DS etc.) proves that Java language is simple to develop applications that are difficult (requires extra practice and experience) in other languages.
Before going into the details of client-server communication, it is advised to go through Networking – Introduction and Communication with TCP/IP Protocol to know the terms and basics of networking and the way Java supports.
Chat communication is the process of exchanging messages between two systems continuously. Anyone can break the communication. Both systems come with the following same responsibilities.
  1. Reading from keyboard. Uses an input stream like BufferedReader connected to System.in.
  2. Sending data to the other system what is read from keyboard. Uses an output stream like PrintWriter connected to getOutputStream() method of Socket.
  3. Receiving data from the other system. Uses an input stream like BufferedReader connected to getInputStream() method of Socket.
As the responsibilities are same, both client and server programs contain the same stream objects and same code. The order of using stream objects varies in the while loop.
Client program: GossipClient.java
Note: To come out of the chat, type Ctrl+C.
Server program: GossipServer.java

keep calm and say bujuku bujuku.

0 comments:

Post a Comment

Start Work With Me

Contact Us
KUTTY SELVA
+91 7708139984
Madurai,Tamilnadu