DosWaitNPipe enables a client process to wait for a named-pipe instance to become available when all instances are busy. It should be used only when ERROR_PIPE_BUSY is returned from a call to DosOpen.

The msec parameter of DosWaitNPipe places a limit on the amount of time the calling process waits for a named-pipe instance to become available, as follows:

If DosWaitNPipe is successful, the client must again call DosOpen to gain access to the pipe instance.

If more than one client process is blocked on a DosWaitNPipe request, the system gives the next available pipe instance to the process whose thread has the highest priority. If all of the waiting threads have the same priority, the thread that has been waiting the longest receives the next pipe instance.

Note: The priority of a thread can be changed by calling DosSetPriority.

ERROR_BAD_PIPE is returned if you specify an invalid name or file handle.


[Back] [Next]