What does Windows error code 535 (ERROR_PIPE_CONNECTED) mean?

 
Previous Next
ERROR_ARITHMETIC_OVERFLOW ERROR_PIPE_LISTENING

ERROR_PIPE_CONNECTED

ERROR_PIPE_CONNECTED can be a successful connection condition for a named-pipe server. It is most important when handling the return value of ConnectNamedPipe.

A race that already produced a connection

A client can connect after the server creates a pipe instance but before the server calls ConnectNamedPipe. In that case, ConnectNamedPipe returns FALSE and GetLastError() returns ERROR_PIPE_CONNECTED, even though the server and client are connected correctly.

Correct server behavior

For this specific ConnectNamedPipe case, treat the pipe as connected and continue to the read or request-processing state. In an overlapped implementation, arrange for the connection state to be processed exactly once, just as if a normal completion notification had arrived.

Common mistake

Closing the handle because ConnectNamedPipe returned FALSE drops a valid client connection. The return value must always be interpreted together with GetLastError().

See Microsoft documentation for ConnectNamedPipe.


Looking for a different code? Search another status or error code.