In this assignment you will build a simple messaging system. This will be a simplified version of MSN Messenger. In detail, your tasks will be
The second part of the assignment consists of building two programs: (1) a server and (2) a client. The server will be running continuously and waiting for incoming client messages. When a client becomes online, the client will send a message to the server with three pieces of information as <Client Name, IP address of the client, Port number of the client>. The server will use this information to maintain a list of online-clients. On receiving this information, the server will send the current list of online-clients to this particular client. The communication between clients and the server will be via UDP.
After a client receives the list of online-clients, it may choose to take the following three actions: (1) terminate the program based on user input, (2) establish a chat session with one of the online clients, or (3) wait for a request to chat from another online client. For the first choice, the client needs to send a message to the server informing the server that it is terminating so that the server can remove this particular client from his online-clients list. For the second choice, the client program will initiate a TCP connection to the user specified online client and start chatting with him/her over a TCP connection. Once such a chat session is done, one of the clients will send type BYE to indicate that they want to end the session and the program will send the last chat message saying BYE and will go ahead and close the TCP connection.
Below is additional information in the form of source code and some explanation (both for C and for Java) that would be useful for you in starting this assignment. We suggest that you first decide if you will use C or Java for the assignment and then study the corresponding code pieces below.
For the first part of the assignment, you will need to meet with TA to make sure that you understand what is expected and discuss your plans on how to proceed the second part of the assignment. For the second part, you will provide the following thru WebCT6: