Question: 1. Develop a network application based on a client-server model. Two clients should be communicating with the server at the same time. The following criteria
1. Develop a network application based on a client-server model. Two clients should be communicating with the server at the same time. The following criteria should be considered for the application. (25 marks) The server should recognize and communicate with only two users John and Meghan. Each of the above clients has a message box on the server that can accept a maximum of 15 messages.
The clients can send either one-line messages to each other or read his/her own messages. A count is maintained for the total number of messages in each mailbox. As and when new messages are received, the count is updated accordingly only if the maximum is not yet reached. When the messages are read, the count is then reduced to zero.
When the message is sent, three pieces of data are to be sent by the client- the users name, the word send, and the original message. When a request to read a message is initiated, the client sends two things: the users name and the word read. As and when each message is received by the server, it is added to the appropriate mailbox (if there are vacant slots available). If the mailbox is full, the message is ignored.
When a read request is received, the server initially sends an integer stating the number of messages (probably 0), that will be sent and then transmits the original message, following which it reduces the total count to zero. Each of the users is to be allowed to send or read as many times as he/she wishes until he/she decides to quit. When the user invokes the quit option, the client sends two things: the username and the word quit. !!!!!!!Please also write the Aim, Algorithm in the end !!!!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
