OSF DCE Application Development Guide--Core Components
OSF DCE Application Development Guide—Core Components
The type_specifier specifies the type for the elements of the pipe. This type cannot be a
pointer type, a type that contains a pointer, a conformant type, a context handle, a
handle_t element type, or a data type that is declared as transmit_as.
A pipe type can be used to declare only the type of an operation parameter. IDL
recognizes three kinds of pipes, based on the three operation parameters:
• An in pipe is for transferring data from a client to a server. It allows the callee
(server) to ‘‘pull’’ an open-ended stream of typed data from the caller (client).
• An out pipe is for transferring data from a server to a client. It allows the callee
(server) to ‘‘push’’ the stream of data to the caller (client).
• An in,out pipe provides for two-way data transfer between a client and server by
combining the behavior of in and out pipes.
A pipe can be defined only through a typedef declaration. Anonymous pipe types are not
supported.
At the interface between the stub and the application-specific code (for both the client
and server), a pipe appears as a simple callback mechanism. To the user code, the
processing of a pipe parameter appears to be synchronous. The IDL implementation of
pipes in the RPC stub and runtime allows the apparent callbacks to occur without
requiring actual remote callbacks. As a result, pipes provide an efficient transfer
mechanism for large amounts of data.
Note however, that pipe data communications occur at about the same speed as arrays.
Pipes can improve latency and minimum memory utilization, but not throughput. Pipes
are intended for use where the receiver can process the data in some way as it arrives, for
example by writing it to a file or passing it to a consumer thread. If the intent is to store
the data in memory for later processing, pipes offer no advantage over arrays.
17.14.4.1 IDL Pipes Example
To illustrate the IDL implementation of pipes, consider the following IDL fragment:
typedef
pipe element_t pipe_t;
When the code containing this fragment is compiled, the IDL compiler will generate the
following declarations in the derived header file:
17 − 30 Tandem Computers Incorporated 124245