SledgeHammer_999
April 12th, 2011, 11:59 AM
Hello,
here's my problem.
I have a program that utilizes dbus-glib. Many instances can be created at a time. The program behavior is this. The first instance creates a bus-name in the session bus and becomes the PRIMARY instance. The other instances call methods on the first instance through dbus. This works well, but I want to solve a corner-case problem.
If my first instance dies/exits/quits then I want one of my other instances to take the bus-name(recreate it actually) and become the PRIMARY instance. My problem is how do I 'watch' a bus name? How do I get notified if a bus name disappears?
ps: I don't want to rely on signals emitted by the PRIMARY instance that it will exit/quit, because A)I think that these don't work asyncronously and B)if the PRIMARY instance crashes no signal will be emitted.
Thanks in advance.
here's my problem.
I have a program that utilizes dbus-glib. Many instances can be created at a time. The program behavior is this. The first instance creates a bus-name in the session bus and becomes the PRIMARY instance. The other instances call methods on the first instance through dbus. This works well, but I want to solve a corner-case problem.
If my first instance dies/exits/quits then I want one of my other instances to take the bus-name(recreate it actually) and become the PRIMARY instance. My problem is how do I 'watch' a bus name? How do I get notified if a bus name disappears?
ps: I don't want to rely on signals emitted by the PRIMARY instance that it will exit/quit, because A)I think that these don't work asyncronously and B)if the PRIMARY instance crashes no signal will be emitted.
Thanks in advance.