Re: Named Pipes in C++



* Steven Brown <riaqnvm7@xxxxxxxxxxx>
| It then says (9 times over) the pipe has been cleared, is still
| open, and that the input string has "xxxxx" in it.

Same here. If I add the diagnostics, I see that after each input
operation which has nothing to read that the stream state is again
EOF. I guess this is just as it is with named pipes.

If I close the stream, reset it and reopen it, the program works as
you intend it to do.

for(;;) {
if (!(pin >> input)) {
pin.close();
pin.clear();
pin.open("testPipe.pipe");
} else {
cout << "You just typed: " << input << endl;
}
}

Again, I'm not expert on this, so my advice would be `do it exactly as
in the example code -- or become an expert yourself' ;-)

HTH
R'
.



Relevant Pages