OSF DCE Application Development Guide--Introduction and Style Guide
OSF DCE Application Development Guide—Introduction and Style Guide
• Automatic method
This is the simplest method of managing the binding for remote procedure calls of an
entire interface. With the automatic method, the server exports its binding
information to a namespace, and the client stub automatically manages a binding for
the application code.
The automatic method completely hides binding management from client application
code. The stub imports the binding information and maintains a binding handle. The
stub passes the binding handle to the runtime with the remote procedure call, and the
runtime uses the binding handle to retrieve the associated binding information. If the
client makes a series of remote procedure calls to the same interface, the stub passes
the same binding handle with each call.
With the automatic method, a disrupted call can sometimes be automatically
rebound. The automatic rebinding requires either that the remote procedure never
begins to execute or that the operation is idempotent. If the call meets either of these
requirements, the RPC runtime automatically tries to rebind the client to another
server (if one is available).
• Implicit method
This is a relatively simple method of managing a binding for an entire interface.
With the implicit method, prior to making any remote procedure calls, the client
application code obtains server binding information from a namespace or a string
binding. The client assigns a server binding handle to a global variable in the client
application (for each interface using this method). When calling a remote procedure
using the implicit method, the client stub passes the specific interface’s global
binding handle to the runtime.
Note: Multithreaded clients must be careful not to allow one thread to change
the value of the shared global binding handle while another thread is
using it.
• Explicit method
This is a more complex yet more flexible method of managing a binding. As with the
implicit method, the explicit method requires that the client application code call
runtime routines to initialize a binding handle. In the explicit method, however, this
binding handle is supplied by the application code as a parameter to the remote
procedure call. By allowing a client to manage bindings for individual calls, the
explicit method enables clients to meet specialized binding requirements.
Figure 4-3 shows the distribution of responsibility for binding management in
applications for each of the three methods. The top portion of each box represents the
client application code written by the developer. The bottom portion of each box
represents the client stub code generated from an IDL interface definition.
4− 10 Tandem Computers Incorporated 124246