WriteFile on a named pipe sometimes returns ERROR_NO_DATA
I've got a C++ program that is creating a named pipe to write data to. Some customers have reported a situation where the client connects to the named pipe but the server end fails to write the data (with ERROR_NO_DATA ). This error code isn't really explained in any MSDN page that I could find; does anyone have any ideas on how to fix this? Or what the cause is? Open code: ostringstream pipeName; pipeName << "\\\\.\\pipe\\unique-named-pipe-" << GetCurrentProcessId(); pipeHandle = CreateNamedPipeA( pipeName.str().c_str(), // pipe name PIPE_ACCESS_DUPLEX, // open mode PIPE_TYPE_BYTE | PIPE