| Previous | Next |
| ERROR_DRIVE_LOCKED | ERROR_OPEN_FAILED |
ERROR_BROKEN_PIPE
ERROR_BROKEN_PIPE means that the write end of a pipe has been closed and the reader has reached the end of the pipe. It is an end-of-stream condition, not a temporary “no data available” state.
Typical situation
For an anonymous pipe, ReadFile returns this code after every writer has closed its handle and no further data can be read. Named-pipe applications can encounter the same condition when the peer has ended the connection.
How to handle it
Stop issuing reads for that connection, finalize any protocol state that has already received a complete message, and close or disconnect the pipe handle. A retry on the same ended connection will not restore it; a new connection requires a new pipe instance or a newly opened client handle.
What to investigate
- Whether the peer exited, crashed, or deliberately closed the pipe.
- Whether shutdown logic closes a pipe handle while another thread is still reading.
- Whether protocol framing allows an orderly end of stream to be distinguished from a truncated message.
See Microsoft documentation for ReadFile.
Looking for a different code? Search another status or error code.
