forked from Kistler-Group/sdbus-cpp
refactor: use pseudo D-Bus connection for plain messages
This commit is contained in:
committed by
Stanislav Angelovič
parent
0f2362d8c3
commit
2991fa4960
+6
-2
@@ -864,9 +864,13 @@ void Signal::setDestination(const std::string& destination)
|
||||
|
||||
PlainMessage createPlainMessage()
|
||||
{
|
||||
static auto connection = internal::createConnection();
|
||||
//static auto connection = internal::createConnection();
|
||||
// Let's create a pseudo connection -- one that does not really connect to the real bus.
|
||||
// This is a bit of a hack, but it enables use to work with D-Bus message locally without
|
||||
// the need of D-Bus daemon. This is especially useful in unit tests of both sdbus-c++ and client code.
|
||||
// Additionally, it's light-weight and fast solution.
|
||||
static auto connection = internal::createPseudoConnection();
|
||||
return connection->createPlainMessage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user