Re: pipes
- From: Rainer Weikusat <rweikusat@xxxxxxxxxxx>
- Date: Wed, 29 Aug 2007 12:17:51 +0200
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.
.
- References:
- pipes
- From: CptDondo
- pipes
- Prev by Date: Re: pipes
- Next by Date: Re: pipes
- Previous by thread: Re: pipes
- Next by thread: Re: pipes
- Index(es):
Relevant Pages
|
|