writing a chat module in java
Not what you're looking for?
The design and structure and helpful tips when writing a chat module in java
Purchase this Solution
Solution Summary
Ideas for writing a chat module in java are presented.
Solution Preview
The Basic Steps Required to write a chat program in java
How does a chat program work ??
A chat program has two main parts- a client program, and a server program
The client program runs on the local machine of the person/people who is/are chatting
The server program runs on another machine, to which each client is connected.
Say three people (A,B,C) are chatting online.
If A wants to send a message to B and C, he sends the message to the server,and the server in turn sends the message to B and C.
A-->(Server)<---B
^
|
C
How do the client and server programs communicate with each other ??
There are a number of ways two remote computers can communicate with each other, a simple way is through TCP Sockets
A socket is a permanent connection between two computers,(similar to a telephone call)
This connection will persist until either one or both computers explicitely disconnect it(exactly like in a telephone call).
How do you make a socket connection from the client to the server?
This can be achieved with the use of just two simple classes in Java - Socket and ServerSocket (located in the java.net
package).
Detailed explanation of each module:
Client Program:
The client program will first establish a socket with the server.
Once it establishes a socket-
1. It will send data to the server through the socket.
2. and it will CONSTANTLY "look out for" or listen to any message which the server would send it
This constant listening for any messages ...
Purchase this Solution
Free BrainMass Quizzes
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
Basic Networking Questions
This quiz consists of some basic networking questions.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.