dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosConnectNmPipe (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSNMPIPES
 
USHORT DosConnectNmPipe(hp)
HPIPE hp;    /* pipe handle */
 
The DosConnectNmPipe function waits for a client to open a named pipe.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hp         Identifies the named pipe. This handle must have been created
           previously by using DosMakeNmPipe.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_BAD_PIPE
     ERROR_BROKEN_PIPE
     ERROR_INTERRUPT
     ERROR_INVALID_FUNCTION
     ERROR_PIPE_NOT_CONNECTED
 
Comments
 
If the client end of a named pipe is open, the DosConnectNmPipe function
returns immediately. If the client end of a named pipe is not open and the
pipe was created with blocking, the DosConnectNmPipe function waits until a
client opens the pipe. If the client end of a named pipe is not open and the
pipe was created with no blocking, the DosConnectNmPipe function returns an
error value immediately.
 
In nonblocking mode, multiple DosConnectNmPipe calls can be issued to poll
the state of a named pipe. If a client has not opened the pipe, the first
call to the DosConnectNmPipe function puts the named pipe into a listening
state and returns immediately with an ERROR_PIPE_NOT_CONNECTED return value.
Subsequent calls to the DosConnectNmPipe function also return this error
value, until a client opens the named pipe.
 
If a named pipe was opened and closed by a client but has not been
disconnected by the controlling process, the DosConnectNmPipe function
returns ERROR_BROKEN_PIPE.
 
See Also
 
DosDisConnectNmPipe, DosMakeNmPipe