PDA

View Full Version : Fail to run own QDBusServer



ghal maraz
9th March 2011, 10:37
Hi,

I am trying to start my own QDBusServer and connect some Applications to it. It seems that the server starts, but the connectToBus()-Method blocks and never returns.

Here is the server code:


int main(int argc, char **argv) {
QCoreApplication a(argc, argv);
new QDBusServer("unix:abstract=/home/ghalmaraz/dbussocket",&a);
return a.exec();
}

Afterwards:

# export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/home/ghalmaraz/dbussocket
# qdbus

shows no reaction (just blocking the terminal)
The qdbusviewer-App blocks for a long time (about 20s), too. But then it starts and gives me the following error message:

Error: Cannot connect to D-Bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

In this moment the server produces output, too:

QDBusConnectionPrivate::connectSignal: received error from D-Bus server while connecting signal to QDBusAbstractInterface::_q_serviceOwnerChanged(QSt ring,QString,QString): org.freedesktop.DBus.Error.Disconnected (Connection was disconnected before a reply was received)

Can someone help me or knows an example for this issue?

best regards
ghal maraz

ghal maraz
9th March 2011, 14:06
I found a bugreport (http://bugreports.qt.nokia.com/browse/QTBUG-186) with the description:


QDBusServer has never really worked.

I heared something similar for qt 4.3, but i could not imagine that this issue is still open and a unusable class
is part of qt for so many versions.