Keep It Simple, Stupid | |
PerlMonks |
Named pipes missing connectionsby bbfu (Curate) |
on Dec 24, 2001 at 03:08 UTC ( [id://134120]=perlquestion: print w/replies, xml ) | Need Help?? |
bbfu has asked for the wisdom of the Perl Monks concerning the following question: I'm having some problems with named pipes, and was hoping some monk could shed some light for me. The problem that I'm having is thus: I have a program that sits waiting for some other program to open a named pipe, at which point it reads all the data from the named pipe, closes the pipe, and acts on the data (it's going to be a mail filter). It then goes back to the start, waiting for another program to open the pipe. The problem is, if the writer opens the pipe too many times, in too short of a period, the reader ends up losing entire sessions of the opened pipe (ie, I never get partial data, just entire times that the pipe was opened by the writer are never seen by the reader). When I try to reduce this to a simple example, however, I get a different problem. In the following simple programs, tstin.pl sometimes gets all the data from tstout.pl in a single connection, instead of one line per connection, as tstout.pl is actually sending it. So, closing the pipe in tstout.pl doesn't seem to propagate to tstin.pl for some reason. It seems very strange to me, but perhaps I'm missing something. I look forward to any advice, or suggestions. tstin.pl
tstout.pl
(Occasional) tstin.pl Output
bbfu
Back to
Seekers of Perl Wisdom
|
|