previous | start | next

Client-Server Programming with RPC

Until now, this unit has only looked at (socket-based) protocols where the details of the protocol are visible to the programmer. An alternative paradigm is that of the Remote Procedure Call (RPC). In this model, a programmer (using an imperative or procedual programming model) thinks of a service on a network server as though it were a sub-routine (or procedure, or function[2]) in almost exactly the same way he/she thinks of a local sub-routine.
 
An RPC application is built (compiled), as usual, but with external (remote) procedures replaced with stub procedures. The RPC system arranges for the stub procedure to transparently send network messages to the remote procedure, and receive returned values. Thus development of networked applications is, in theory at least, not harder than development for a single machine. The Unix RPC system (originally developed at Sun Microsystems) uses a canonical form called XDR (eXternal Data Representation) data encoding system for sending data across the network. It is quite a complex specification: we will examine how one data type -- the integer is handled.
 

 
[2] "Sub-routine" is an historical generic term for a re-usable code-segment with formally specified parameter passing conventions. The term procedure was used for the same thing in Pascal, and function in C.
Lecture 24: Data Formats and Encoding -- A Philosophy Lecture Copyright © 2002 P.Scott, La Trobe University Bendigo.



previous | start | next