Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
A client app is calling CallNamedPipe to connect to a server app. The timeout is set for 3 seconds.

If, at that moment, the pipe-server does not exist yet. Will CallNamedPipe wait 3 seconds for the server-side pipe to get created?

Or, would it fail immediately?
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jan-11 23:52pm    
Peter, may I ask you why waiting, especially 3 seconds :-)

If the pipe is not created on server path in 3 seconds, it may well be not created another hour. If the server was started in advance, then the client will be connected anyway. Perhaps you want to start client and server "almost at the same time"? Then, this would be bad design...
Peter Weyzen 6-Jan-11 3:47am    
The client is a windows shell extension (on explorer.exe)... It actually starts long before the server starts up.

The concern wasn't really about that, but about a loop inside the server which accepts connections. There's a small window between when the incoming pipe is connected, before the next connection can happen. My concern was about what happens to the caller inside that window -- is it possible that the call from the shell could fail inside that window of time.

I know little about the ins and outs of pipes -- code was received from a contractor...

Thanks for confirming this.

1 solution

According to this[^] it waits if the pipe being called is not available.
 
Share this answer
 
Comments
Peter Weyzen 5-Jan-11 22:12pm    
Thanks -- just looking for confirmation!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900