-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBus daemon and dbus-send tool #207
Comments
As far as I see right now, there seem to be multiple issues with this setup. |
This change includes several changes at once. 1) Use Object[] instead of a Map for the message header The header was stored in a Map<Byte, Object>, where the byte key defines the header field number in the actual message. Using Map as container provided a nicer API but creates additional overhead. Also the get() calls on a Map always uses hashCode() to find the proper key. Additionally, changes made to the header Map were never written back to the message. As the key is just a byte and the header of a DBus message only has 10 entries, an array of Object is the better option. The array index defines the position in the message header. Index 0 is omitted (invalid according to DBus Spec). Looking up values using the array index is a lot faster. 2) Fix issues when running as daemon (Issue #207) When the Java DBusDaemon was used and a second program exported methods to this DBusDaemon, requesting results from these methods using dbus-send failed. This was due to the message header was corrupted when a message was forwarded to the requester. Updating the target for a message was done using setSource() method which was (and still is) a very nasty beast. First it clears the current buffers, then rewrites the initial part of the message. After that, the header is rewritten (that part was wrong since the beginning). After the header the body bytes are appendend. The broken part did remove the 'signature' indicating byte for any MethodReturn call.
Alright... after a 2 days of investigation and trail & error I finally got it. This setup has two major problems, one is a bug in dbus-java, the other is the usage of First the bug: This was a really difficult to find and fix bug. The second issue is your usage of |
Thank you very much! Everything works perfectly. :) |
Nope, no ETA for any release. Maybe in a few weeks somewhere in february/march depending on how much issues are arsing until then. |
Hello,
Currently, we have a setup with Java DBus daemon, Java service that exports object, and Java client that sends messages to the exported object. And it works like a charm.
However, we recently noticed that
dbus-send
tool does not work properly - it doesn't receive a response from Java daemon.An example:
We tried to send messages to the daemon via command-line and got the following response:
At the same time if the request is sent without asking for response the command-line succeeds:
If we send command to the system DBus, response from the requested service is received:
Is there some miss-configuration of the daemon on our side?
Are we doing something wrong or missing something? Please help us to solve the issue.
Attaching a gist with simple project with the daemon and exporter: link
The text was updated successfully, but these errors were encountered: