[asio] Named pipes on Windows?
Hi all, I'm working on a cross platform server daemon. Clients communicate with the daemon using boost asio. For the posix implementation, it's convenient and appropriate in our case to use Unix domain sockets. I've experimented with the related asio "local" sample code and verified that it will work for our purposes. For Windows it looks like named pipes are sort of the equivalent of Unix domain sockets. But while asio has a "stream_handle" interface that accepts a Windows handle, all of the sample and test code passes invalid handles. I haven't found any working sample or test code that specifically integrates named pipes with asio. All I've found so far is an email to this list on March 13th from Andrew Solodovnikov who was having problems getting named pipes to work with asio. Has anyone successfully used asio and Windows named pipes? If so, would you be willing to share some sample code that demonstrates the functionality? Thanks in advance. Best, -- Allen Cronce
On Thu, 23 Apr 2009 16:27:58 +0200, Allen Cronce
[...]Has anyone successfully used asio and Windows named pipes? If so, would you be willing to share some sample code that demonstrates the functionality?
I've used asynchronous operations with named pipes in Boost.Process. The named pipe is hidden within Boost.Process and not exposed by the library (this is something which will probably change). The code however works. I wrote an article about Boost.Process only a few days ago. There is a sample with Boost.Asio at http://www.highscore.de/cpp/process/index.html#communicating. Here's the code which I use to create a named pipe: https://svn.boost.org/svn/boost/sandbox/process/boost/process/detail/pipe.hp... (search for BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE). HTH, Boris
participants (2)
-
Allen Cronce
-
Boris Schaeling