OSF DCE Application Development Guide--Core Components

Interface Definition Language
This practice is not recommended, however, since it violates the opaqueness of the
context handle type.
The type name in a context handle declaration must be no longer than 23 characters.
The first operation on a context creates a context handle that the server procedure passes
to the client. The client then passes the unmodified handle back to the server in a
subsequent remote call. The called procedure interprets the context handle. For
example, to specify a procedure that a client can use to obtain a context handle, you can
define the following:
typedef [context_handle] void * my_context;
void op1(
[in]handle_t h,
[out] my_context * this_object);
To specify a procedure that a client can call to make use of a previously obtained context
handle, you can define the following:
void op2([in] my_context this_object);
To close a context, and to clean the context on the client side, you can define the
following:
[in, out, context_handle] void * my_context;
The resources associated with a context handle are reclaimed when, and only when, the
manager changes the value of the in,out context handle parameter from non-NULL to
NULL.
17.14.9.2 The Context Rundown Procedure
Some uses of context handles may require you to write a context rundown procedure in
the application code for the server. If communications between the client and server are
broken while the server is maintaining context for the client, RPC invokes the context
rundown procedure on the server to recover the resources represented by the context
handle. If you declare a context handle as a named type, you must supply a rundown
procedure for that type.
When a context requires a context rundown procedure, you must define a named type
that has the context_handle attribute. For each different context handle type, you must
provide a context rundown procedure as part of the manager code.
The format for the rundown procedure name is as follows:
context_type_name_rundown
A rundown procedure takes one parameter, the handle of the context to be run down, and
delivers no result. For example, if you declare the following:
124245 Tandem Computers Incorporated 17 61