hPipe = CreateNamedPipe(
lpszPipename, // pipe name
PIPE_ACCESS_DUPLEX, // read/write access
PIPE_TYPE_MESSAGE | // message type pipe
PIPE_READMODE_MESSAGE | // message-read mode
PIPE_WAIT, // blocking mode
PIPE_UNLIMITED_INSTANCES, // max. instances
BUFSIZE, // output buffer size
BUFSIZE, // input buffer size
0,
I have two questions about this:
- what if the above code is run twice,how many pipes will get created,
1
or2
? - if
2
,suppose one of the pipe get connected by A,then B tries to connectlpszPipename
, is it guaranteed that B will connect to the one that no one has connected?