Tom Pollard
11/20/2006 1:19:00 PM
On Nov 17, 2006, at 6:05 AM, Paul Lutus wrote:
> Named pipes are opened and read or written as though they were files
> (streams). Just open it by path and name.
>
>> The two programs are running under Windows XP, btw.
>
> Are you asking how to create the named pipe? That is an operating
> system
> function, and frankly, I don't know if Windows supports them. The
> operating
> system must support the idea of a named pipe, and if it doesn't, no
> named
> pipe.
Windows also has named pipes, but they behave somewhat differently
than Unix named pipes. I only have experience with them in C and
Perl programming, but I found that you can't do non-blocking reads on
a named pipe under Windows, and you can't open, close and reopen the
same named pipe in a program. Basically, to use a named pipe for
accepting messages under Windows, you probably need to spawn a
separate thread to listen to it.
If you're porting Unix software that uses named pipes to Windows, you
might be best off selecting a different IPC mechanism altogether,
such as sockets. In our porting efforts, we ended up writing a small
library that simulated Unix named pipes under Windows using shared
memory.
Tom