Math Client/Server – Middleware-RPC

Objectives:

o Enhance the understanding of client-server architecture of distributed systems

o Practice the usage of RPC


You will design and implement a Math server that provides the following four remote procedures:

• magicAdd( ): takes 2 double parameters and returns the difference between the 2 values;

that is it actually does subtraction operation;

• magicSubtract( ): takes 2 double parameters and returns the sum of the 2 values;

• magicFindMin( ): takes 3 int values as parameters and returns the largest value; and

• magicFindMax( ): takes 3 int values as parameters and returns the smallest values.

Moreover, the Math server should keep some counters to record the number of different operations it

has performed, and the corresponding methods to retrieve these numbers.

On the client side, a client will generate 1000 RPC requests, where each request randomly chooses

one of the 4 operations as well as the corresponding required parameters. At the end, the client should

retrieve the number of operations performed by the server.

Your program should support running more than one (at least two) client concurrently.

The server and client programs should be able to run on separate machines. You can program with

any language.