techcode has asked for the wisdom of the Perl Monks concerning the following question:
One of the modifications requested is that they can order it to drop some connection (all connection for one user - as there can be more than one connection/child for one user). As it is in that business, everyone keeps open connections, even if they have nothning to send, and just enquire link commands every x seconds (keep alive ping). The business is SMS providing (wholesale of SMS's).
As it's only the child knowing what user is logged in it, I was thinking of setting a shared memory key to username/id to be dropped, and sending a signal (say SIGUSR1) to program group. Childs would process SIGUSR1 and check if it's their user, and if it is, drop the connection.
But I was also thinking on being able to call functions from/in parent (or child) and pass a few parameters. Existing mechanisms such as pipes seem like a way too complicated as I would need to implement a lot of surounding code. Check for anythnig in the pipe ...
A perlish idea I have to do that, is to set a shared variable to say "function('param1', 234);" and signal the parent/child(s) who would simply EVAL that - would that even work? Anyone used somethnig like that?
Any other, simple way of calling functions from another process, where you "control" (can change code) both sending/receiving sides.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: child and parent process communication
by shmem (Chancellor) on Sep 03, 2008 at 08:35 UTC | |
Re: child and parent process communication
by cdarke (Prior) on Sep 03, 2008 at 09:36 UTC | |
Re: child and parent process communication
by jbert (Priest) on Sep 03, 2008 at 11:59 UTC | |
Re: child and parent process communication
by zentara (Cardinal) on Sep 03, 2008 at 13:48 UTC | |
Re: child and parent process communication
by tmaly (Monk) on Sep 03, 2008 at 12:56 UTC |