When reading from a NamedPipes server using the .net NamedPipeClientStream class I can only get the data on the first read in C++, every time it's just an empty string. In c# it works every time.
pipeClient = gcnew NamedPipeClientStream(".", "Server_OUT", PipeDirection::In);
try
{
pipeClient->Connect();
}
catch(TimeoutException^ e)
{
// swallow
}
StreamReader^ sr = gcnew StreamReader(pipeClient);
String^ temp;
while (temp = sr->ReadLine())
{
// = sr->ReadLine();
Console::WriteLine("Received from server: {0}", temp);
}
sr->Close();