To simplify, this is a situation where a NamedPipe SERVER is waiting for a NamedPipe CLIENT to write to the pipe (using WriteFile())
The Windows API that is blocking
Try this before ReadFile :
BOOL WINAPI PeekNamedPipe( __in HANDLE hNamedPipe, __out_opt LPVOID lpBuffer, __in DWORD nBufferSize, __out_opt LPDWORD lpBytesRead, __out_opt LPDWORD lpTotalBytesAvail, __out_opt LPDWORD lpBytesLeftThisMessage ); if(TotalBytesAvail > 0) ReadFile(....);
-AV-