Question ad private DBUS server, how to ...
rony
rony at wu.ac.at
Mon Aug 8 12:02:55 PDT 2011
Hi Havoc,
thank you very much for your information!
On 08.08.2011 02:58, Havoc Pennington wrote:
> On Sun, Aug 7, 2011 at 2:05 PM, rony <rony at wu.ac.at> wrote:
>
>> When setting up a private DBUS server, it is possible to accept/get
>> connections to clients.
>>
>> Is there a way to find out as a server, when a client went away?
>>
>> Or with other words: how could one determine the connection that got
>> shut down at the client side (in order to close that connection on the
>> server) while the server goes on waiting on new clients?
>>
> You should get a Disconnected message on the server side in this case.
> (A disconnect looks the same on both client and server side, if I
> remember correctly and nothing has changed.)
>
In the past couple of hours I have tried to go after that.
At one point (about two hours ago) I was surprised, because indeed I got
a signal from "org.freedesktop.DBus.Local" (object path
"/org/freedesktop/DBus/Local") and a member named "Disconnected"! Then I
started to change the code to cater for the Disconnect signals (to
inform the Rexx DBus server object about the client's disconnection),
but ever since it did not appear anymore. Not really sure why, as to the
best of my knowledge I have not done anything that could possibly impact
DBus.
To reassure you or anyone else: the language binding implementation has
its own message loop for connections using
"dbus_connection_read_write(conn,milliTimeout)" and dumping all received
messages does not yield the "Disconnect" signal message! (This is on
DBus 1.4.6, 64-bit Ubuntu.)
[The implementation of the language binding has for each connection an
own message loop running on its own thread, each employing
dbus_connection_read_write(); in addition, if a private server is
created in addition a watch-loop runs (for allowing clients to connect
to the server instance) on its own thread as well.]
So, I am really stumped and would be very greatful for any ideas, hints
that could direct me where to look and what to go after! It would be
very helpful to learn from DBus when a connection from a client to the
server got disconnected.
TIA,
---rony
More information about the dbus
mailing list