Question: In this laboratory, you will be converting our single client-server example into a multi client-server setup. By default your server is a C++, The two


In this laboratory, you will be converting our single client-server example into a multi client-server setup. By default your server is a C++, The two clients should be of different platform, Use a Java environment and a Python environment. What the program will do is to accept two numbers from the client, pass it on the server, the server will compute for the sum, and sends it back to the client. The client prints the sum There is a need to convert our server lecture code example to accept multiple clients (as shown on the video example I modified our server lecture example to accept multiple clients, however I specifically ran two Java instances) of course I will not share the code :D because you have to do it yourselves. But ill be giving you tips on how you will do it. - Create another method to separate the code accepting clients this is from the accept() method upto the close() method of the original program. So you would need to make other variables as global. The general idea here is that you will be running this method on a separate thread. Let us say we have named this method as acceptClient(). - Write an infinite loop that waits for client connection - while(true)\{ acceptClient(); \} - Launch acceptClient as asynchronous thread, otherwise your server program will behave sequentially thus it would end up accepting only single connection everytime. By making it asynchronous it will reloop again and start another client connection once a client is connected already. SUBMIT THE FOLLOWING - C++ Server Code - Java Client Code - Python Client Code - Recorded Screen Video (same video example that I showed) In this laboratory, you will be converting our single client-server example into a multi client-server setup. By default your server is a C++, The two clients should be of different platform, Use a Java environment and a Python environment. What the program will do is to accept two numbers from the client, pass it on the server, the server will compute for the sum, and sends it back to the client. The client prints the sum There is a need to convert our server lecture code example to accept multiple clients (as shown on the video example I modified our server lecture example to accept multiple clients, however I specifically ran two Java instances) of course I will not share the code :D because you have to do it yourselves. But ill be giving you tips on how you will do it. - Create another method to separate the code accepting clients this is from the accept() method upto the close() method of the original program. So you would need to make other variables as global. The general idea here is that you will be running this method on a separate thread. Let us say we have named this method as acceptClient(). - Write an infinite loop that waits for client connection - while(true)\{ acceptClient(); \} - Launch acceptClient as asynchronous thread, otherwise your server program will behave sequentially thus it would end up accepting only single connection everytime. By making it asynchronous it will reloop again and start another client connection once a client is connected already. SUBMIT THE FOLLOWING - C++ Server Code - Java Client Code - Python Client Code - Recorded Screen Video (same video example that I showed)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
