Take Assessment: Practical Quiz 1
 This is a resumption of your previous attempt.
Please note: At this time, we cannot track responses you entered previously.   Please answer the following question(s).
If the assessment includes multiple-choice questions, click the "Submit Answers" button when you have completed those questions.  Please complete this assessment by Fri Apr 21 20:46:15 UTC+0800 2006.  
  1. 
 Go to bottom of question.   TCP Chat Server
Background 
Messages 
Messages from the Client to the Server 
Messages from the Server to the Client 
Coding Style 
Submission 
Background
Write a simple TCP chat server using Java sockets that complies with the chat protocol listed later. It should read messages from each client, and rebroadcast those messages to all clients. Your server should read in a port from the command line. The server should listen for requests on that port. It should also handle multiple concurrent connections, which means you will need to spawn a thread for each new connection.We have provided here a graphical client that you can use to connect to your chat server. Download and run GUIClient.jar. Use the following command line to invoke GUIClient.jar.java -jar GUIClient.jar <hostname> <port> <alias> 
Above, <hostname> is the host name of the machine the server is running on, <port> is the port number of the server, and <alias> is the name with which your messages will be associated on the chat server. Messages
Messages from the Client to the Server
Messages from the client to the server will look like this:type^alias@hostip^target^message^ For this quiz, target will always be a dash. The type of the message can be one of the following.m — a regular message, where message is just the message being sent. 
j — a user has joined; message should be a dash, to signify no message. 
p — a user has parted; message should be a dash, to signify no message. 
An example regular message could be as follows. 
m^[email protected]^-^This is an example message^ An example join message could be as follows. j^[email protected]^-^-^ An example part message could be as follows. p^[email protected]^-^-^ Messages from the Server to the Client
Your server will only transmit the first kind of message (type m from above) to the client. This means that you will have to translate join and part messages. You should include the host name of the person joining, as well as the time. Consider the following example.j^[email protected]^-^-^ Should be transformed into the following message when it is retransmitted to all clients.m^[email protected]^-^Alice has joined from sledge.carnegietech.org (12:42 PM)^ Coding Style
You are expected to design classes in an object-oriented manner using good programming practices. For example, you will lose points if you implement your programs' functionality inside one large main function.Your code must be written using Java coding conventions. Your code must be well documented and contain a README file with instructions on compiling and running each program.Submission
Submit the following file:ChatServer.java 
README file 
 
  Go to top of question.  
 -------------------------------------------------------------------------------- File to submit:
  
  
 --------------------------------------------------------------------------------
  Go to top of assessment.           
&copy; Copyright 2003 iCarnegie, Inc. All rights reserved.