OSF DCE Application Development Guide--Core Components
Developing a Simple RPC Application
6. Generate object code from application code.
7. Create an executable client and server from the object files. Figure 11-5 illustrates
this task.
For the client, link object code of the client stub(s) and the client application with
the RPC runtime and any other needed runtime libraries.
For the server, link object code for the server stub(s), the initialization routines,
and the set(s) of remote procedures with the RPC runtime and any other needed
runtime libraries.
8. After initial testing, distribute the new application by separately installing the
server and client executable images on systems on the network.
Figure 11-5. Building a Simple Client and Server
RPC and
libraries
other DCE
runtime
Client
stub
Calling
code
stub
Server Server
initialization
code
Remote
procedure
code
RPC and
libraries
other DCE
runtime
Server
Linker Linker
Client
11.2 Writing an Interface Definition
Traditionally, calling code and called procedures share the same address space. In an
RPC application, the calling code and the called remote procedures are not linked;
rather, they communicate indirectly through an RPC interface. An RPC interface is a
logical grouping of operations, data types, and constants that serves as a contract for a
set of remote procedures. DCE RPC interfaces are compiled from formal interface
definitions written by application developers using IDL.
The first step in developing a distributed application is to write an interface definition file
in IDL. The IDL compiler, idl, uses the interface definition to generate a header file, a
client stub file, and a server stub file. The IDL compiler produces header files in C and
can produce stubs as C source files or as object files.
For some applications, you may also need to write an Attribute Configuration File (ACF)
to accompany the interface definition. If an ACF exists, the IDL compiler interprets the
ACF when it compiles the interface definition. Information in the ACF is used to modify
the code that the compiler generates. (The greet example does not require an ACF.)
The remainder of this section briefly explains how to create an interface definition and
gives simple examples of each kind of IDL declaration. For a detailed description of
124245 Tandem Computers Incorporated 11−9