Create a very simple mail service. This system should have a Unix domain socket server as the server. And you should also write a client for the service. Once a client is connected to the server it...

Create a very simple mail service. This system should have a Unix domain socket server as the server. And you should also write a client for the service. Once a client is connected to the server it will have three options. First one is to send a mail (there is no target). Read the last sent mail which would also erase it. And ask how many unread emails there are. All three options should be represented with a single character: s for send, r for read, and c for count. The server should read one character at a time to handle these options. Once s is received, server must wait data until a \n is found. You can use the sample code provided in the class for this task. If r is received, server must sent the last message followed by a \n and it should reduce the mail count. And if c is received, server should send the count of the mail in textual format. You can use sprintf for this purpose. Do not use itoa as it is not standard and not supported in Linux. Server should keep on reading commands until the client closes the connection.
Client first should connect to the server and then while it is running, it should display a menu with 4 options: send mail, display mail count, read mail and quit. Send should use read(0, ...) to obtain data from the user. Client should send appropriate sequence to the server to perform the operation requested by the client.
You must perform all error checks. There will be some points for usability and quality of the programs.
You must also write a short document that contains explanation how you structured your program, and how to use it. The document should also contain some screenshots and copy of your codes.
Aug 19, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here