Qt-interest Archive, June 2007
QDBusServer not finished?
Message 1 in thread
Hi.
Looking at QDBusServer in Qt 4.3.0.
First of all, in the function
void QDBusConnectionPrivate::setServer(DBusServer *s, const
QDBusErrorInternal &error)
There's a test which says
if (! server) {
fail..
}
In other words, if there isn't already an internal server, fail to set a
new one. The test should be "if (! s)".
However, even fixing this doesn't give a working dbus server at the
supplied address. Is there an ETA on a working QDBusServer
implementation for Peer-to-peer communication between programs?
--
[ signature omitted ]
Message 2 in thread
Hi,
> Looking at QDBusServer in Qt 4.3.0.
> [...]
> if (! server) {
> fail..
> }
>
> In other words, if there isn't already an internal server, fail to set a
> new one. The test should be "if (! s)".
Indeed this looks suspect. Have you already reported this bug?
http://trolltech.com/bugreport-form
> However, even fixing this doesn't give a working dbus server at the
> supplied address. Is there an ETA on a working QDBusServer
> implementation for Peer-to-peer communication between programs?
Would you have a minimal compilable example that reproduces the problem?
--
[ signature omitted ]
Message 3 in thread
>
>> Looking at QDBusServer in Qt 4.3.0.
>> [...]
>> if (! server) {
>> fail..
>> }
>>
>> In other words, if there isn't already an internal server, fail to
>> set a new one. The test should be "if (! s)".
>
> Indeed this looks suspect. Have you already reported this bug?
> http://trolltech.com/bugreport-form
>
No, I wasn't really sure if QDBusServer was considered "production" and
hence something you were looking for bug reports on?
>> However, even fixing this doesn't give a working dbus server at the
>> supplied address. Is there an ETA on a working QDBusServer
>> implementation for Peer-to-peer communication between programs?
>
> Would you have a minimal compilable example that reproduces the problem?
Absolutely. Once the above fix is added, compile:
#include <QtCore>
#include <QtDBus>
int main(int argc, char **argv) {
QCoreApplication a(argc, argv);
new QDBusServer("unix:abstract=./dbussocket",&a);
return a.exec();
}
then in a shell:
export DBUS_SESSION_BUS_ADDRESS=unix:abstract=./dbussocket
/usr/local/Trolltech/Qt-4.3.0/bin/qdbus
Watching the output from the program with QDBusServer, you'll get
SERVER: GOT A NEW CONNECTION
This comes from this implementation defined in qdbusintegrator.cpp:
static void qDBusNewConnection(DBusServer *server, DBusConnection *c,
void *data)
{
Q_ASSERT(data); Q_ASSERT(server); Q_ASSERT(c);
Q_UNUSED(data); Q_UNUSED(server); Q_UNUSED(c);
qDebug("SERVER: GOT A NEW CONNECTION"); // TODO
}
If you strace the program, you'll also see that the newly accept()ed
socket is closed before anything has been read from it or any events
have take place.
All of this leads me to believe this part of QtDBus isn't quite finished
yet :)
Qt is not alone in missing point-to-point support; it seems many of the
language bindings only support the classic daemon-based bus approach.
However, point to point functionality is something I'd very much like to
have and one of the things which attracted me to QtDBus in the first
place, which again leads to my original question of the current ETA of
the finished implementation :)
--
[ signature omitted ]
Message 4 in thread
Hi,
> No, I wasn't really sure if QDBusServer was considered "production" and
> hence something you were looking for bug reports on?
Since QDBusServer has been introduced in Qt 4.2 and is documented, it's
supposed to be "production". However it looks like QDBusServer has not been
used widely yet...
I've filed a bug report for you. Thanks for reporting this.
--
[ signature omitted ]
Message 5 in thread
On Tuesday 12 June 2007 01:47:16 Thorvald Natvig wrote:
> Hi.
>
> Looking at QDBusServer in Qt 4.3.0.
>
> First of all, in the function
> void QDBusConnectionPrivate::setServer(DBusServer *s, const
> QDBusErrorInternal &error)
>
> There's a test which says
>
> if (! server) {
> fail..
> }
>
> In other words, if there isn't already an internal server, fail to set a
> new one. The test should be "if (! s)".
>
> However, even fixing this doesn't give a working dbus server at the
> supplied address. Is there an ETA on a working QDBusServer
> implementation for Peer-to-peer communication between programs?
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/
Hi,
Unfortunately you're right, QDBusServer is not in a functioning state in Qt
4.3.0. We are working hard to fix this. It's hard to give an ETA on this,
other than "as soon as possible".
Regards,
Marius
--
[ signature omitted ]