Raised dbus-demon for local tcp session: host = localhost, port = 12345 nmap shows that this demon is hanging on this port. I registered the environment variable DBUS_SESSION_BUS_ADDRESS tcp: host = localhost, port = 12345. dbus-monitor.exe says that there is a server. And from QT I try to connect and does not give an error org.freedesktop.DBus.Error.Disconnected. Tell me in which direction to look for manuals?

qDebug() << QProcessEnvironment::systemEnvironment().value("DBUS_SESSION_BUS_ADDRESS"); if (!QDBusConnection::sessionBus().isConnected()) { qDebug()<< QDBusConnection::sessionBus().lastError(); //qDebug() << QDBusConnection::sessionBus().name(); fprintf(stderr, "Cannot connect to the D-Bus session bus.\n" "To start it, run:\n" "\teval `dbus-launch --auto-syntax`\n"); return 1; } 

Update:

 QDBusConnection connection= QDBusConnection::connectToBus(QProcessEnvironment::systemEnvironment().value("DBUS_SESSION_BUS_ADDRESS"),"dbus"); if (!connection.isConnected()) { qDebug() << connection.lastError(); int i; i++; } 
  • one
    I do not see the connection to the daemon in this code, is it not all code? Show all the code. - ixSci
  • I also tried to connect QDBusConnection connection= QDBusConnection::connectToBus(QProcessEnvironment::systemEnvironment().value("DBUS_SESSION_BUS_ADDRESS"),"dbus"); if (!connection.isConnected()) { qDebug() << connection.lastError(); int i; i++; } QDBusConnection connection= QDBusConnection::connectToBus(QProcessEnvironment::systemEnvironment().value("DBUS_SESSION_BUS_ADDRESS"),"dbus"); if (!connection.isConnected()) { qDebug() << connection.lastError(); int i; i++; } QDBusConnection connection= QDBusConnection::connectToBus(QProcessEnvironment::systemEnvironment().value("DBUS_SESSION_BUS_ADDRESS"),"dbus"); if (!connection.isConnected()) { qDebug() << connection.lastError(); int i; i++; } But the result was the same. - Efimov Evgeny
  • Add the code to the question, it is difficult to read in the comments - ixSci
  • Delivered the code in the body of the question - Efimov Eugene

1 answer 1

Found an answer to your question. The PATH environment variable must be the path to dbus-1.dll