Reputation: 5124
I have a pipe (server) on one process waiting for clients with ConnectNamedPipe
.
In the client process I'm waiting for the server to start listening with WaitNamedPipe
, I gave it a timeout of 5000 ms.
I tried testing the client and even though the server wasn't running, WaitNamedPipe
didn't wait at all.
I don't know if any code would be helpful here because I just try to use those methods. But if you want to see something, just tell me what is relevant. :)
oh, and the weird part is that it gave me error code 2: "file not found'.
Isn't it supposed to wait until the pipe is opened (the pipe is the "file", isn't it?)
What can cause WaitNamedPipe
not wait?
Upvotes: 0
Views: 3013
Reputation: 175816
It does not wait for a pipe to come into existence, it waits for an existing pipe to become available (i.e. an outstanding ConnectNamedPipe
):
If no instances of the specified named pipe exist, the WaitNamedPipe function returns immediately, regardless of the time-out value.
Upvotes: 2