Program algorithm.

quit command: "\exit" ... 
this string is entered by a user on his client application when he wish to terminate his connection. It is send to the TCPServer, which will echo this message to the sender alone. The server will close the associated socket,and the serverThread object, and remove it from its list of clients.
On the Client side, either socket exception or reception of this keyword will call the exit method which will close all connections and quit the client program.

TCPServer.

1.Open a serverSocket.
2.Accept client connecection and handover to a TCPserverThread.the main returns to listening for serverSocket
3.Maintain a list of thread.
4.send message to all client by calling the send message() defined in the serverThread class.
5.on user input close the server terminating all threads. 

TCPserverThread.
0. open the datainpoutStream on this socket
1.receive messages from a client though the datainputstream.
2a. call the server to send the message to all the Clients
2b. provide a message send method which will write a data on the dataoutput stream on the socket.
3a. on receiving a quit message from a client call the server to remove this thread from the list of serverThread.
3b. close the socket.

TCPClient

1.Start applet
2.read ip address 
3 establish tcp socket connection.
4.open datainputstream of socket. Bind it to applet textField.
5. join dataOutputStream of the socket to button event "send" message.
6.User may enter some string in the applet textarea.then hiting the send button will write the string is written to the dataOutputStream of the socket. 
7.receive data from server.
8.If data is quit command,quit the program.Otherwise print the data on to the system.out
9.if the press the "bye" button ,disconnect from server by sendin quit to the server and closing current socket.
10.User may enter some string and hit the enter. This will enable the data display function to resume writing on the screen, while the string is written to the dataOutputStream of the socket.