Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between two application in the same local machine

Tags:

c

linux

I am using C language and Linux as my programming platform.

I am developing a user-space application that runs in a background, like a daemon. And my problem is, I want another user-space application to communicate with this daemon.

I know that I have to use Interprocess Communication method but I don't know what is the correct implementation.

But using IPC in my communication implementation is my other option. Actually I just want to change the attribute of my daemon by using another application. Please see below a senario:

  1. My daemon runs in a background.
  2. Then some application will control the properties of a daemon, like sleeping delay time.

My first option is by accessing a file with the values of the properties. So that my deamon will poll that values. While the other application will change that values.

I am not sure the efficiency of my options. Please advice.

THanks.

like image 782
domlao Avatar asked Jun 26 '10 04:06

domlao


1 Answers

Updating the config file and sending a signal to cause re-read is a standard practise, cheap and easy.

like image 178
Dr. belisarius Avatar answered Oct 05 '22 06:10

Dr. belisarius