Named Pipes

Named pipes enable related or unrelated processes on the same computer system or different systems to communicate with each other. Any process that knows the name of a pipe can open and use a named pipe. In addition, named pipe data can be transparently redirected across a network, such as a local area network (LAN).

Note: The current file system implementation for VDMs does not support named pipes across the LAN. (This limitation will go away with future versions of OS/2 V2.0). To use named pipes within a VDM and across the LAN, you would have to boot a real DOS session (see also Virtual Machine Boot). You would also have to load the LAN Support Program and the DOS LAN Requestor within such a VMBOOT session. If you do that, your network adapter will be used by that DOS session exclusively and cannot be shared with any other session on this machine.

One process (server process) creates the pipe and connects to one end of it. Other processes that access the named pipe are called client processes; they connect to the other end of the pipe. The server and client processes can then pass data back and forth by reading from and writing to the pipe. The server process controls access to the named pipe.

The client process can be either local or remote. A local client process is one that runs on the same computer system as the server process. A remote client process runs on a different system and communicates with the server process across a local area network (LAN).

The DOS applications running in different VDMs can only work as client processes. The OS/2 application for this kind of IPC has to be the server process. That is because there are no equivalent pipe APIs in DOS to create a named pipe, etc. there are only the standard I/O commands. This means that the DOS client process can read and write from and to the pipe, but it cannot create one. To do this the DOS client has to know the name of the named pipe to be able to use it like it would use a flat file to open it and process the I/O calls.

There is an exercise included in the appendixes that demonstrates a VDM IPC and shows you the sample code (see Lab Session 5: VDM Interprocess Communications for more information).


[Back: About Pipes]
[Next: Summary]