A real time scenario where a student enter his WIN-SEM marks for five subjects and then request the Server to compute the grade and percentage he/she gets based on his/her marks. I have also implemented basic mathematical operations like subtraction and factorial where the result is computed by the server.
- RPC(Remote Procedure Call) method helps clients to communicate with servers by the conventional use of procedure calls in high-level languages.
- RPC method is modeled on the local procedure call, but the called procedure is most likely to be executed in a different process and usually a different computer.
- RPC provides abstraction. For example, the message-passing nature of network communication remains hidden from the user.
- RPC allows the usage of the applications in a distributed environment that is not only in the local environment.
- Once the IP address of server is provided, client can execute complex methods which are taking more space to execute and get result from server. By doing this code redundancy is reduced and many clients can interact with same server to execute the same method present in server and get their wanted results back.
- Reduces space complexity as one method stored in one place i.e, server method can be executed by large number of clients.
- Ubuntu 14.04.6 LTS
- C
- RPCGEN
- Oracle VM VirtualBox
- Download ubuntu version 14.04.6 LTS and install on your VM VirtualBox.
- Type
sudo apt-get install rpcbindin your ubuntu terminal. - Locate the RPC folder and paste the grade.x file.
- Navigate to the RPC folder in terminal and type
rpcgen -a -C grade.xto compile the above file. - Type
make -f Makefile.gradeto compile the newly created files and to generate additional files(server and the client ones). - Open another terminal and type
sudo ./grade_serverto start the server and typesudo ./grade_client localhoston the other. - The above steps can be followed for the subtraction and factorial too.
- Input the mark values for each subject where these parameter values are passed and calls the remote method.
- The result is returned by the server method and the result is printed on the client side.
- RPC Runtime: RPC run-time system is a library of routines and a set of services that handle the network communications that underlie the RPC mechanism. In the course of an RPC call, client-side and server-side run-time systems’ code handle binding, establish communications over an appropriate protocol, pass call data between the client and server, and handle communications errors.
- Binding: How does the client know who to call, and where the service resides?