Re: Using sdbus-cpp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fr, 26.02.21 10:45, Carlo Wood (carlo@xxxxxxxxxx) wrote:

> Nevertheless-- I'm still facing blocking behavior:
> Following a simple example, I'm using:
>
>     auto reply = concatenatorProxy->callMethod(method);
>
> which ends up calling poll, and block :/.
>
> To make a long story short, what do I have to do to be
> able to use this library if I don't want it to block?

I can't comment on the C++ wrapper, it's not maintained by us. But
sd-bus itself is fully async, all calls are by default async, but for
some there are synchronous wrappers, for convenience. For example, for
calling a method use sd_bus_call_async() if you need things
asynchronously. Use sd_bus_call() if you want a simple synchronous
wrapper for that.

See the the man page sd_bus_call(3) for details.

You can interate sd-bus into arbitrary event loops if you like, or use
the one we provide, via sd-event. Use
sd_bus_get_fd()/sd_bus_get_events()/sd_bus_get_timeout() for
integration to foreign event loops.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux