OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
Clients can use any practical combination of RPC interfaces, whether offered by the
same or different servers. For this example, using a database access interface, a client on
a graphics workstation can call a remote procedure on a database server to fetch data
from a central database. Then, using a statistics interface, the client can call a procedure
on another server on a parallel processor to analyze the data from the central database
and return the results to the client for display.
11.2.2 Generating an Interface UUID
The first step in building an RPC application is to generate a skeletal interface definition
file and a UUID for the interface. Every interface in an RPC application must have a
UUID. When you define a new interface, you must generate a new UUID for it.
Typically, you run uuidgen with the -i option, which produces a skeletal interface
definition file and includes the generated UUID for the interface. For example, the
following command creates a file chess.idl:
uuidgen -i > chess.idl
The contents of the file are as follows:
[
uuid(443f4b20-a100-11c9-baed-08001e0218cb),
version(1)
]
interface INTERFACENAME {
}
The first part of the skeletal definition is the header, which specifies a UUID, a version
number, and a name for the interface. The last part of the definition is {}(an empty pair
of braces); import, constant, type, and operation declarations go between these braces.
By convention, the names of interface definition files end with the suffix .idl. The IDL
compiler constructs names for its output files based on the interface definition filename
and uses the following default suffixes:
• .h for header files
• _cstub.o for client stub files
• _sstub.o for server stub files
For example, compilation of a chess.idl interface definition file would produce a chess.h
header file, a chess_cstub.o client stub file, and a chess_sstub.o server stub file. (The
IDL compiler creates C language intermediate files and by default invokes the C
compiler to produce object files, but it can also retain the C language files.)
For more information on the UUID generator, see the uuidgen(1rpc) reference page.
11 − 12 Tandem Computers Incorporated 124245