Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2 (12,5 points) - Write the client and server side programs in C of an echo service, i.e., a service which returns back whatever it
Q2 (12,5 points) - Write the client and server side programs in C of an echo service, i.e., a service which returns back whatever it receives from clients back to them. The clients and server should communicate over the sockets mechanism. The server side should be a multi-threaded application which is capable of servicing multiple clients concurrently in parallel. In addition to the message sent back to its clients, your server should indicate to its client the order of him among all the clients he has served since startup. That is, the first client asked for the service should receive, in addition to the echo of his message, the information that he is the first client so far, the second client should receive the information that he is the second client so far, and so on. You can order the clients according to the time when their first connection requests have been received and accepted by the server. If the same client asks for the same service at some later time once again, the information he received should be the same as before, i., e., you should not increment the order of the same client if he wants to get the service some time later. You can check for the identity of your clients based on their IP address, and port number combinations. Only different clients should get increasing order numbers, the same client can not be both, for example, the third, and the tenth requestor during a single run of the server
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started