| Previous | Next |
| ERROR_PIPE_BUSY | ERROR_PIPE_NOT_CONNECTED |
ERROR_NO_DATA
ERROR_NO_DATA is a named-pipe state result whose meaning depends on the API call and the pipe mode. It often indicates that an operation cannot proceed because no usable data or connected client is available at that moment.
Read on a nonblocking pipe
For a named pipe in nonblocking wait mode, ReadFile can return ERROR_NO_DATA when the pipe buffer is empty. This does not mean that the connection has necessarily failed; it means that a blocking read would have had to wait for another writer.
Connection lifecycle case
ConnectNamedPipe can also return this code when the previous client closed its handle and the server has not yet called DisconnectNamedPipe. In that case the server must finish the old connection lifecycle before reusing the pipe instance for a new client.
Do not use PIPE_NOWAIT as an event loop
Repeatedly polling a nonblocking named pipe can waste CPU and hide connection-state errors. For asynchronous servers, use overlapped I/O and completion notifications instead of treating ERROR_NO_DATA as a reason for a busy retry loop.
See Microsoft documentation for named-pipe type, read, and wait modes and ConnectNamedPipe.
Looking for a different code? Search another status or error code.
