Communicating through the pipe object

Besides message passing, Windows offers other ways to communicate and share data between processes and threads. One of these ways is the pipe object. Pipe is the object in memory that the processes use for their communication. The process that creates a pipe is the pipe server. A process that connects to a pipe is a pipe client. One process writes information to the pipe, and then another process reads the information from the pipe.

We will implement a small client-server example. One process will be a server; another one will be a client. The server will run for an infinite period of time. We will use the pipe object for process communication. Every time the client connects, the server needs to accept the ...

Get C++ Multithreading Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.