Pipes

The pipe type constructor is a highly efficient mechanism for passing large amounts of data, or any quantity of data that is not all available in memory at one time, during a remote procedure call. When you use a pipe, the RPC runtime handles the actual data transfer, thus you eliminate the overhead associated with repeated remote procedure calls.

You define a pipe type in the interface definition and then use that type as a parameter in remote procedure calls. You use the pipe with the in attribute parameter to pull, or transfer data from the client to the server. You use the pipe with the out parameter to push, or transfer data from the server to the client.

In relation to the input and output parameters, this push and pull terminology may seem counter-intuitive. It is helpful to keep in mind that the server application and the client stub are the active agents, working in concert to pull the data from the client application for an input parameter, and to push the data back to the client application for an output parameter. The server stub and the client application are passive parties to this exchange. The terms push and pull, then, describe the server application's action on the data.

The following topics discuss how to use the pipe type constructor in the IDL interface, the client application, and the server application. For more information on pipe syntax and restrictions, see pipe in the MIDL Language Reference. The PIPES sample program in the Win32 SDK directory samples\rpc demonstrates how to use [in,out] pipes to transfer data between a client and a server.