tags:

views:

696

answers:

2

Is it possible to use overlapped I/O with an anonymous pipe? CreatePipe() does not have any way of specifying FILE_FLAG_OVERLAPPED, so I assume ReadFile() will block, even if I supply an OVERLAPPED-structure.

+5  A: 

No. As explained here, anonymous pipes do not support asynchronous I/O. You need to use a named pipe. There's example code to do this on MSDN here and here.

ChrisN
+1  A: 

Here is an implementation for an anonymous pipe function with the possibility to specify FILE_FLAG_OVERLAPPED. If the link should die in the future search the net for MyCreatePipeEx.

Thanks! That's just what I needed.
Steve Hanov