[ale] Named Pipe
jknapka at kneuro.net
Tue Mar 20 16:54:26 EDT 2007
David Corbin wrote:
> I have an application for which a named pipe seems like the right answer on
> several fronts, but what I don't want is for the writing application to block
> if there is noone reading it. I just want one application to stream data to
> the pipe, and have some other application be able to jump in 'mid-stream' and
> start processing the input data.
> Is this possible with linux named pipes?
I don't think so -- I think if you set a pipe to non-blocking
mode, writes that would over-fill the pipe just fail. (I
could be wrong, haven't looked at the Stevens book in a long
time.) Therefore, whatever starts reading the pipe could get
some really old data.
I think a series of UDP messages sent to a particular local
port would work almost as well. When nothing's listening
on the port, you may get failed writes, but whenever something
*does* start listening, it will get the latest data, not
stuff that's been sitting there since a pipe filled.
More information about the Ale