On Sat, 29.04.17 20:31, Federico Di Pierro (nierr...@gmail.com) wrote:

> Hi!
> I'm struggling to understand if this can be done: suppose i start polling
> on sd_bus_get_fd() without any match; then, after some event happens, i add
> a match on same bus.
> Will i receive events on my fd just going on polling?
> Ie: will this work?
> fd = sd_bus_get_fd();
> event_happened = 0;
> poll(fd);
> if (event_happened) sd_bus_process();
> else sd_bus_process(); sd_bus_add_match();
> 
> It seems it is not working, but i cannot understand if my idea is
> completely wrong or if something else is happening.
> I mean, fd is still the same obviously, i am only telling sd_bus that i'm
> now interested in certain messages, by hooking a callback; am i mistaken?

I am not sure I follow what you are trying to say.

But yes, you can add and remove matches on an existing connectio any
time, and you'll get events from the matches from the moment you
install it on until you remove it again (or the connection is
terminated).

Lennart

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

Reply via email to