Peer to Peer DBus Connection with Qt
Tim Sander
tim at krieglstein.org
Thu Mar 28 15:47:56 PDT 2013
Hi Thiago
Thanks for your reply.
> First of all, you should not package your entire Git repository. You can use
> the git archive command to create a tarball that is suitable for
> consumption. And in your specific case, you only had to send two .cpp
> files: the client and the server.
Ups i just forgot the git repository in there sorry. I just kept the project
files to make compilation really easy. But thinking about it, it would have
been probably better to just append the unzipped files which is easier to
review.
> Unfortunately, your test is invalid. In dbuspeerserver/main.cpp, you do:
>
> QDBusConnection::systemBus().registerService("this.is.a.peertest");
>
> Registering names on the system bus is only permitted if you have rules
> installed by the system administrator allowing that. So the call above is
> silently failing.
Well i had a dbus viewer running where could see the server. So i know for
sure that the service "this.is.a.peertest" was registered and running. Also i
was querying the error string. It changed from "" to "other" after i have
started the client program. So i am pretty confident that there has been some
interaction between these services.
> In turn, your client is doing:
>
> QDBusReply<QString> reply=QDBusConnection::systemBus().call(m);
> if(reply.isValid()) {
>
> Since the system bus registration failed, the call above will also fail.
> Therefore, you never enter the block of code that tries to test the peer
> connection.
I am sure that the service was running as i have been seeing it on the dbus
viewer. Also this is a embedded system with a dbus which is configured very
relaxed as the software environment is strictly defined.
> Conclusion: we have no idea if the peer connection works or not. You did not
> get to test it.
I am sure that i tested it but i am not sure if my programs where correct as
the documentation of the peer to peer stuff is very sparse.
Best regards
Tim
More information about the dbus
mailing list