Local server-client communication

Hi, i’m coding a linux local server (daemon) and it will have a command
line tool to communicate with it.

What I want to accomplish is something like iptables tool, you write
some rules on the command line and they are sent to the “daemon”, in
this case the kernel module.

How can I achieve it? I’ve seen ruby does not support mkfifo, and a
solution based on system() calls is really ugly.

Unix socket? plain file?

what do you use?
thanks in advance

On 11/02/2010 07:51 AM, Javier 12 wrote:

Unix socket? plain file?

what do you use?
thanks in advance

Unix sockets are fine for this purpose. You can write your own protocol
on top of them, or use druby (assuming the client is in ruby too).

Unix sockets are fine for this purpose. You can write your own protocol on
top of them, or use druby (assuming the client is in ruby too).

Drb might work for you, as well.

On 11/02/2010 09:59 AM, Roger P. wrote:

Unix sockets are fine for this purpose. You can write your own protocol on
top of them, or use druby (assuming the client is in ruby too).

Drb might work for you, as well.

Just so the OP knows, drb and druby are the same thing. (I’m sure you
know, Roger!)