535 - ERROR_PIPE_CONNECTED может быть в случае, когда клиент уже подключен вот из справки MSDN о ConnectNamedPipe:
| Цитата | Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If a client connects before the function is called, the function returns zero and GetLastError returns ERROR_PIPE_CONNECTED. This can happen if a client connects in the interval between the call to CreateNamedPipe and the call to ConnectNamedPipe. In this situation, there is a good connection between client and server, even though the function returns zero | |