I have a basic Win32 console app that makes a call to a named pipe, and then Sleep(1000), inside a while(true) loop. After a hundred iterations, Sleep(1000) will hang. I can see no reason for this.
Ok, all I'm doing is taking the code found in this MSDN sample, verbatim and running it as the server: http://msdn.microsoft.com/en-us/library/aa365601%28VS.85%29.aspx
Then I take the code found in this MSDN sample for the client found here: http://msdn.microsoft.com/en-us/library/aa365592%28VS.85%29.aspx, and I modify it so that it moves all of the calling code into a separate method, and then from within main() calls it like this:
while (true)
{
sendmsg();
Sleep(1000);
}
I should add that the problem happens when I run multiple instances of the client, say around 4 or 5 instances. I can see no reason for this. There is no synchronization at all taking place. The code is exactly as is found in the two links, save for the change to run the client code in a loop, with a Sleep(1000) after each call.