[Interest] Determine caller of currently invoked D-Bus adaptor method?

Matt Hoosier matt.hoosier at gmail.com
Tue Jul 30 15:53:04 CEST 2013


Hi,

For purposes of tracking resources, I'd like to be able to tell the
identity (i.e., unique bus name) of the client who's invoking my D-Bus
service methods.

That is, something like the following:

  QDBusUnixFileDescriptor SomeService::foo(QString const& inputArg) {

    QDusMessage& msg = ....; // Need this
    QString senderBusName = msg.service();

    int fd = open( ... );

    // Clean this up later if we receive a notice that the sender's bus name
    // has disconnected.
    m_ResourcesByClient[senderBusName] = fd;

    return QDBusUnixFileDescriptor( fd );
  }

It doesn't appear that the adaptor framework offers a simple way to fetch
the QDBusMessage on whose behalf the current slot method has been invoked,
though. Did I perhaps miss a way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130730/58a8a511/attachment.html>


More information about the Interest mailing list