| Previous | Next |
| STATUS_ILLEGAL_FUNCTION | STATUS_PIPE_CLOSING |
STATUS_PIPE_DISCONNECTED
STATUS_PIPE_DISCONNECTED indicates that the pipe handle refers to an instance that is not currently connected to its peer. The handle may still exist, but the instance is not in the state required for reading, writing, or other connected-pipe operations.
Where the state comes from
A named-pipe server can explicitly call DisconnectNamedPipe after finishing with a client, and a client can disconnect by closing its handle. After the connection ends, the server must complete the documented disconnect/reconnect sequence before the same instance is used for another client. Attempting I/O in the wrong state can produce this status.
How to handle it
- Separate pipe-handle ownership from connection state in the application's state machine.
- On the server side, stop pending work for the old client, close or disconnect the instance as appropriate, then call
ConnectNamedPipebefore servicing a new client. - On the client side, discard the session state and reconnect through the normal endpoint-discovery and authentication path.
- Do not treat this as a permission or payload-format error; the remedy is to restore a valid connection lifecycle.
The difference from STATUS_PIPE_BROKEN is useful in logs: a broken pipe reports that the peer end closed during an operation, whereas a disconnected status describes the current state of the named-pipe instance itself.
See Named Pipe Operations, ConnectNamedPipe, and FSCTL_PIPE_PEEK reply statuses.
Looking for a different code? Search another status or error code.