in reply to Reading from a UNIX daemon

At this point, your "daemon" might better be described as a simple background process because all it does is collect data. It sounds to me like you are actually looking for advice on how to turn it into a daemon.

In general, a daemon is a program that monitors something and acts when there is a change. A server is a special kind of daemon that waits for a connection on a port. Some daemons monitor a spool directory and go into action when a file is placed in the spool. There are, of course, many other variations on the same idea.

It might make sense for your program to analyze the data as it collects it and then do something when it detects one or more conditions. (At which point your program would accurately be described as a daemon.) On the other hand, it might make sense for your program to simply collect the information and then hand it out to clients that connect to a port and request it. (At which point your program would accurately be called a daemon and just as accurately be called a server.)

Before we can adequately help, it would help us to know what you want to do with the data that you collect. If it is something simple, then building a server might be overkill. If, however, the data might be used for a variety of things or from a variety of places a server could be the way to go.

What exactly are you trying to accomplish?

-sauoq
"My two cents aren't worth a dime.";