OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
14.3.4.2 Distinct Service Instances on a Single Host
With the service model, when multiple server instances on a given host are somehow
unique, each instance must export to a separate server entry. The exported binding
information must contain one or more instance-specific, well-known endpoints or an
instance UUID. Well-known endpoints and instance UUIDs are used under the
following circumstances:
Well-known endpoints
An instance-specific, well-known endpoint must be provided to a server instance
as part of its installation; for example, as a command-line argument. Before
calling the export operation, the server instance tells the RPC runtime to use each
of its well-known endpoints; it does this by calling
rpc_server_use_protseq_ep( ). The runtime includes these endpoints in the
instance’s binding information, which the runtime makes available to the instance
via a list of server binding handles. The server instance uses this list of binding
handles to export its binding information, including the well-known endpoints.
The server also uses this list of binding handles to export its well-known endpoint
with the local endpoint map; it does this by calling rpc_ep_register() or rpc_-
ep_register_no_replace(). Remote calls made using an imported well-known
endpoint from a server entry are guaranteed by the RPC runtime to go only to the
server instance that exported the endpoint to that entry.
Note: Only one server instance per system can use a well-known endpoint
obtained from a given interface specification.
Instance UUID
Create an instance UUID only for a new server entry. Generating a new instance
UUID each time a server instance exports to a server entry will result in many
instance UUIDs that are difficult to manage and may affect performance as new
instance UUIDs are constantly added to server entries. If a new server instance
inherits a currently unused server entry left behind by an earlier instance, before
exporting, the new server instance should inquire for an instance UUID in the
server entry; this is done by calling the
rpc_ns_entry_object_inq_{begin,next,done}() routines. If the inherited entry
contains an instance UUID, the server uses it for an instance UUID, rather than
creating and exporting a new instance UUID. If an inherited entry lacks an
instance UUID, however, the server must create a UUID and export it to the
server entry.
Note that every server instance must register its instance UUID along with its
endpoints in the local endpoint map.
Note: Using an instance UUID precludes any other use of object UUIDs
for the application.
Figure 14-16 shows distinct instances of a statistics-service server on the same host.
Each server instance uses an instance UUID to identify itself to clients. The instance
UUID is the only object UUID a server instance exports to its server entry. Starting
at the statistics-service group, clients import the statistics interface.
14 42 Tandem Computers Incorporated 124245