Building upon the lab demonstration from November 10th, implement a Unix chat server, capable of echoing UDP-based messages to up to five clients. Your chat server should take a port number as a command-line option.
The protocol for the chat server is very simple. The first message sent to the server should be a null-terminated client string that identifies the user represented by the client. When a new client joins the chat server, a message announcing the new user should be sent to all connected clients.
Each subsequent null-terminated message from a client should be echoed back by the chat server to all connected clients, prepended by the corresponding user name.
If any client sends the message "exit", the chat server should exit cleanly.
BONUS: If a client sends the message "close", the chat server should close that client connection, announce that the user has left the session, and leave an open slot for potential new clients to join if the server already had five connections open.
You may use the built-in Unix netcat utility "nc" for early testing of your chat server, but once the server is operational, construct your own client that obeys the protocol for connecting to the server.
Your client should take three command-line arguments: a server, a port number, and a user name.
Finally, adapt your echo shell command from the previous assignment to act as a Xinu-based version of your Unix chat client. If your IP routing module is working, you should have no trouble connecting to chat servers on the production Systems Lab workstations.