OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
1.6.1 Importing the Binding Information from the Namespace
The first important thing that the client does is to acquire a binding to the server it wants
to request services from. From the client’s point of view, there are several binding
choices to be made.
The first choice is in regard to the binding method to be used; however, this is
determined and implemented as part of the development coding process (the .acf file).
The binding method chosen has an effect both on what the client has to do in the present
step to acquire bindings, and subsequently on what it must do to maintain them. In this
step, it will be assumed that either the explicit or implicit method was chosen. If auto-
binding were chosen, there would be no need for a discussion, since the client would
then have nothing to do.
1.6.1.1 Getting a Handle
The second choice involves how to get a binding handle. Again, this is a choice that is at
least partially dependent on decisions already made. The client can always generate a
binding handle for itself; the problem is where to get the information that belongs in it.
There are two general solutions, as follows:
The client imports from the namespace binding handles that already contain the
necessary information, or
The client receives the information in string form from user input, from a file, from
another server, or from any other source. It then converts the string into a binding by
calling rpc_binding_from_string_binding( ).
The normal way for a server to make its location known to clients is to export its binding
information into the namespace. The client can then call the following RPC name
service library routines to import one or more bindings from the specified namespace
entry:
rpc_ns_binding_import_begin(entry_name_syntax, entry_name, if_handle,\
obj_uuid, &import_context, &status);
rpc_ns_binding_import_next(import_context, &binding_handle, &status);
rpc_ns_binding_import_done(import_context, &status);
The name service sees to it that only compatible bindings exported under the specified
interface, with the optionally specified object UUID, will be returned to the client. (Note
that the interface specification is not contained in the binding, although it is exported to
the namespace entry where it is used by the name service for matching entries to
prospective importers.) The object UUID specified by obj_uuid is contained in the
binding, if it is present. This is the object UUID that was (optionally) registered under a
type UUID in an earlier step. Even if obj_uuid is not specified in the import call, it will
be returned in the binding handle(s) if it was exported by the server.
1 26 Tandem Computers Incorporated 124246