Between the child closing its end of the pipe, and the server disconnecting the pipe, any attempt by the server to read from the pipe will result in a value of 0 returned to it. An attempt to write to it will result in ERROR_BROKEN_PIPE error returned. ERROR_PIPE_BUSY will be returned to all clients trying to open the pipe.
If the client's end is still open when the server issues DosDisConnectNPipe, it will result in the pipe being disconnected from the server, closed on the client side. There are two things to note about the client here. It does not specifically get a message that the pipe has been closed for it, instead it will recieve an error next time it tries to access the pipe. The other thing to note is that since the server forced closing of the client side, data that has not yet been read by the client will be lost.
Blocked threads are awakened by DosDisConnectNPipe. A thread blocked by DosRead will recieve a value of zero for bytes read. A thread blocked by DosWrite will recieve the ERROR_BROKEN_PIPE error.
The client's handle becomes invalid by the server calling
DosDisConnectNPipe, but it does not free the handle. Therefore the client
must issue DosClose in order to free the
Last modified March 17/1996
Please send all errors, comments, and suggestions to: email@example.com
The OS/2 API Project