Assignment 7: Chatroom Dr. Huaqing Wang I. Purposes: - GUI programming, event handling - Socket and Client-Server programming. - Multiple Threading - Monitor and Synchronization II. Files: - Chatroom0316.zip contains two files, ChatroomServer.java and ChatroomClient.java, is availbe on my website. - Two programs are tested running on the same and separatte machines. When client and server running on differnt machine, the host name must be changed to server mahine first. When 2 or more test the chatroom program, the port number of server program must be changed to a different port number from 9999. The client program must have same port number as your server. III. Key Conpcepts of Client-Server programming with Sockets - A soket can be thought as pipe with the following diferencecs - A pipe are used to link two threads/processes running on the same machine A socket link to thread/process betwo two threads/proesses on the same or different machines. - Pipe is one-direction data channel while a socket is bi-directional channel. - Java provide two socket classes: ServerSocket and Socket while Unix sysem has one socket. - Socke is one of mechanism for remonte connections, and RMI (remote method Innocation) is another one but higher level machanism for internet communication among programs. IV. What You need to do for this assignment Based on the given program, you will exend it by sending message to all or selected clients. Specifically, you need to 1. Add a list of JCheckBox with Client's ID and name of all chatroom clients. The check boxes can be checked and unchecked, 2. Display the check boxes on the right or east-side area of the the JFrame. 3. A message will sent to all checked clients. If no client is checked, the message will send only to checked client. V. Some suggestions. 1. Let Server agents to get a unique ID for each client. 2. Create a message class class Message { String msg; String listOfRecievers; } 3. Replace Vector of ObjectOutputStream with Map< Integer, ObjectOutputStream> with client ID as Key of the map, and ObjectOutputStream as value.