Re: pipes



CptDondo <yan@xxxxxxxxxxxxxxxx> writes:
I have a basic question about pipes...
I have an app that will read an instrument about 10x a second. The
data read will take about 12 bytes.

It would be easiest for me from a programming standpoint write the app
so it simply dumps the data into a pipe, and any other app that needs
the data will read it from the pipe.

It's quite possible that this app might be dumping data into the pipe
for days without anyone reading it.

The data is realtime; once it's read it has no time value at all, so I
really don't care if it goes into a bit bucket.

Is it possible to set up a pipe so that the data just "falls out" if
no one is reading it?

You could use an unconnected PF_UNIX datagram socket and sendto to
send the updates to some AF_UNIX destination address. If someone cares
(ie another process has a PF_UNIX datagram socket bound to this
address), that someone will be able to receive the data, otherwise,
the sending process will get some error (eg ECONNREFUSED or ENOENT)
which it can ignore.

But not using reliable communication may be a better solution, cf Alex
Colvin's post.
.



Relevant Pages

  • Re: to be (readable) or not to be (readable), thats the question.
    ... I want my app to be robust and detect dumb processes. ... I kill a *child* of the process connected to. ... Now, if I send some instruction down the pipe (yes, the pipe is still ... Is there an explanation for getting pipe readable events in this case? ...
    (comp.lang.tcl)
  • Re: Connect a pipe from asynchronous pluggable protocol?
    ... But I ran into some problem when using the APP to connect. ... multi-threads that is created with NULL as security too, ... If you specify NULL for the security attributes structure then the pipe is ... discretionary access control lists. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: pipes
    ... I have an app that will read an instrument about 10x a second. ... the data will read it from the pipe. ... for days without anyone reading it. ... pipe or any other data channel at these specified intervals. ...
    (comp.unix.programmer)
  • Re: Demobomb for Windows
    ... redirects stdout to a file or device. ... You can't have two redirects on a line... ... The pipe command does not create a file, ... from one app to another app running the first app first, ...
    (alt.lang.asm)
  • Re: pipes
    ... It would be easiest for me from a programming standpoint write the app ... the data will read it from the pipe. ... for days without anyone reading it. ... No crash. ...
    (comp.unix.programmer)