Boost logo

Boost :

Subject: Re: [boost] [Interprocess] Named pipe interface proposal
From: Boris Schaeling (boris_at_[hidden])
Date: 2013-08-11 08:11:58

On Sat, 10 Aug 2013 03:45:38 +0200, Geoff Shannon
<geoffpshannon_at_[hidden]> wrote:

Hi Geoff,

> [...]As a point of interest this interface is meant to be extremely
> simple. I
> don't intend to initially support ANYTHING except for basic creation and
> reading and writing.

I'm interested in named pipe support as Boost.Process could benefit a lot
(not an official Boost library but everyone calls it like that).

We have a function called create_pipe() which creates an anonymous pipe
The function returns an object which is similar to a pair of file
descriptors/Windows handles (see
<>). The
library refers to these things as pipe ends. The pipe ends can be used to
create a boost::iostreams::file_descriptor_source or
boost::iostreams::file_descriptor_sink object to do synchronous I/O (see

For asynchronous I/O Windows requires a named pipe. Boost.Process doesn't
provide anything out of the box to help users though. There is a
create_async_pipe() function used in the documentation. But it's left as
an exercise to the reader to implement it. :/ I actually implemented it in
the unit tests. But there is too much hardcoded that it's of any use to

This function create_async_pipe() returns the same pair of file
descriptors/Windows handles as create_pipe() does. Instead of putting
these pipe ends into Boost.Iostreams objects they are now used to
instantiate boost::asio::windows::stream_handle or
boost::asio::posix::stream_descriptor (see
These classes from Boost.Asio can be used as is for asynchronous I/O with
named pipes.

All of that is really a low-level view as you actually deal with file
descriptors/Windows handles. I don't know whether you want to go that way
(your interface makes me think you are higher level). If you can provide a
Boost.Asio I/O object for named pipes, or if you can provide access to the
pipe ends of your named pipe it would however help to make asynchronous
I/O with Boost.Process easier to use.


Boost list run by bdawes at, gregod at, cpdaniel at, john at