Re: callback functions...signals ...events... process communications



On Sat, 2004-11-06 at 20:08, Tristan Van Berkom wrote:
On Fri,  5 Nov 2004 17:21:50 -0200, viola das inpe br <viola das inpe br> wrote:

   Hi everybody!
    I am francisco viola; this is my first time; they say that I'll never forget...
      So, I would like to know if I could attach a callback function to a signal
or event (?) that is fired (I mean "signaled") from inside another program
running in parallel? And how could this program pass a string to the callback
function, just before the signal firing? Does gtk offer some gadget to do these?

   There is no IPC mechanism provided out of the box in Gtk+, I've always had 
to write my own. Generaly, I usualy use unix sockets if I know I'm
running on the  same machine, but network sockets can work as well (socket, bind, accept, 
read, write kind of thing). Up till now, I've always used GIOChannelto add these
sockets as event sources (GSource) to the main loop (GIOWatch), I think there is
some kind of merge comming from the GNet library that will be integrated into
gtk+ (I'm not 100% sure...).

Speaking about IPC, for Francisco's needs System V message queues should
work, as he wants to "call" and send a simple string to the application.

ITOH one app should be the "client" - send to the queue - and other the
"server" - listen the queue - with this approach.

Other caveat is it will not work in all *nix flavours, and of course
will not work at all on Win32.
-- 
Iago Rubio



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]