Re: [boost] [boost.asio] file / pipe io service

Hi Martin, Martin Slater <mslater@netspace.net.au> wrote:
The read failed with WSAECONNRESET, which I take as "will not work".
But I would be glad to hear, that it will work, and that I have to only find out what I did wrong.
Sorry I wasn't as clear as I could be, I'm only using sockets for what I would like to use named pipes for. I use regular win32 ReadFile in a thread currently to receive output on stdout/err and was hoping that this would fit nicely into the asio model too and let me remove this code and the neccessary synchronisation..
I think the email to which you're replying must have gone astray -- at least I can't find it in my email client or in the list archive. Can you post the whole problem again, thanks. Cheers, Chris

I think the email to which you're replying must have gone astray -- at least I can't find it in my email client or in the list archive. Can you post the whole problem again, thanks.
Hello Chris! I have sent the following message only to you (got a delivery failure) and Martin. On Wed, Aug 16, 2006 at 08:23:00PM +1000, Martin Slater wrote:
Was it anonymous or named pipes you were thinking of? Anonymous pipes in particular look like easy pickings on both UNIX and Win32, so I could add them once I get the TR2 proposal out of the way.
AFAIK only named pipes can be used/opened for win32 overlapped i/o.
Both of them ;-) Ideally I would be able to attach an existing OS pipe handle as well so I could use it for reading output from std streams of a child process, i'm ignorant of the issues on unix like systems for this behaviour though. Currently I'm using sockets instead of pipes for local interprocess connections anyway so I can still use asio and can live with this for a while so I'm more than happy to wait until you have time;)
Is it possible to inherit sockets as stdin/out/err Handles for CreateProcess? I tried to write a small testcase yesterday, that 1. creates a connected socket pair, 2. derives a inheritable handle (DuplicateHandle) from the first socket, 3. closes the first socket, 4. creates a child process with the handle as stdout handle, 5. closes the handle, and 6. reads from the second socket. The read failed with WSAECONNRESET, which I take as "will not work". But I would be glad to hear, that it will work, and that I have to only find out what I did wrong. -- Goetz Isenmann

Hi Goetz, Goetz Isenmann <G.Isenmann@science-computing.de> wrote:
I have sent the following message only to you (got a delivery failure) and Martin.
Ah ok, thanks for resending.
AFAIK only named pipes can be used/opened for win32 overlapped i/o.
In the entry for CreatePipe, MSDN says: Anonymous pipes are implemented using a named pipe with a unique name. Therefore, you can often pass a handle to an anonymous pipe to a function that requires a handle to a named pipe. I haven't tried it, however.
Is it possible to inherit sockets as stdin/out/err Handles for CreateProcess? I tried to write a small testcase yesterday, that 1. creates a connected socket pair, 2. derives a inheritable handle (DuplicateHandle) from the first socket, 3. closes the first socket, 4. creates a child process with the handle as stdout handle, 5. closes the handle, and 6. reads from the second socket.
The read failed with WSAECONNRESET, which I take as "will not work".
Yeah, I don't know the answer, sorry. You might try not closing the socket handles and see if that makes a difference. Cheers, Chris
participants (2)
-
Christopher Kohlhoff
-
Goetz Isenmann