forked from Kistler-Group/sdbus-cpp
Introduce support for asynchronous D-Bus method calls on the client side (#42)
Fixes #32
This commit is contained in:
committed by
GitHub
parent
004f158817
commit
663df31398
@@ -648,6 +648,17 @@ MethodReply MethodCall::createErrorReply(const Error& error) const
|
||||
return MethodReply(sdbusErrorReply);
|
||||
}
|
||||
|
||||
AsyncMethodCall::AsyncMethodCall(MethodCall&& call) noexcept
|
||||
: Message(call)
|
||||
{
|
||||
}
|
||||
|
||||
void AsyncMethodCall::send(void* callback, void* userData) const
|
||||
{
|
||||
auto r = sd_bus_call_async(nullptr, nullptr, (sd_bus_message*)getMsg(), (sd_bus_message_handler_t)callback, userData, 0);
|
||||
SDBUS_THROW_ERROR_IF(r < 0, "Failed to call method asynchronously", -r);
|
||||
}
|
||||
|
||||
void MethodReply::send() const
|
||||
{
|
||||
auto r = sd_bus_send(nullptr, (sd_bus_message*)getMsg(), nullptr);
|
||||
|
||||
Reference in New Issue
Block a user