OSF DCE Application Development Guide--Core Components
Interface Definition Language
Example of a Context Rundown Procedure
/*
* fh_rundown.c: A context rundown procedure.
*/
#include <stdio.h>
#include "context_handle.h" /* IDL-generated header file */
void file_handle_t_rundown
(
file_handle_t file_handle /* Active context handle */
* (open file handle) */
)
{
/*
* This procedure is called by the RPC runtime on the
* SERVER side when communication is broken between the
* client and server. This gives the server the
* opportunity to reclaim resources identified by the
* passed context handle. In this case, the passed
* context handle identifies a file, and simply closing
* the file cleans up the state maintained by the context
* handle, that is "runs down" the context handle. Note
* that the file_close manager operation is not used here;
* perhaps it could be, but it is more efficient to use
* the underlying file system call to do the close.
*
* File handle is void*, it must be cast to FILE*
*/
fclose((FILE *)file_handle);
}
17.15 Associating a Data Type with a Transmitted Type
The transmit_as attribute associates a transmitted type that stubs pass over the network
with a presented type that clients and servers manipulate. The specified transmitted type
must be a named type defined previously in another type declaration.
There are two primary uses for this attribute:
• To pass complex data types for which the IDL compiler cannot generate marshalling
and unmarshalling code.
• To pass data more efficiently. An application can provide routines to convert a data
type between a sparse representation (presented to the client and server programs)
and a compact one (transmitted over the network).
124245 Tandem Computers Incorporated 17− 65