To do this two objects are required. The first is the client side stub. The client object then awaits the result from the server and passes it back to the user. The second object is the serverside implementation. Implementing the calculator To avoid undue complexity we have provided a substantial skeleton for the exercise.
Lets look at the two parts of the implementation.
We will start with the client side stub. The definition of the client side stub is contained in the file CalculatorClient.h, the implementation in the file CalculatorClient.cc. On return from dispatchRPC the mathematics methods simply unpack the integer reply and return the result. The dispatchRPC method does the communication with the server using the Port and PortAddress classes as described in the lectures. The definition of the server side of the calculator is contained in the file CalculatorServer.h and the associated implementation in the file CalculatorServer.cc.