<div dir="ltr">Thanks, that was the information i was looking for.<div>Indeed i was able to solve the issue!</div><div>Again, thank you very much,</div><div><br></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Federico</div></div></div></div></div>
<br><div class="gmail_quote">2017-04-30 12:55 GMT+02:00 Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, 29.04.17 20:31, Federico Di Pierro (<a href="mailto:nierro92@gmail.com">nierro92@gmail.com</a>) wrote:<br>
<br>
> Hi!<br>
> I'm struggling to understand if this can be done: suppose i start polling<br>
> on sd_bus_get_fd() without any match; then, after some event happens, i add<br>
> a match on same bus.<br>
> Will i receive events on my fd just going on polling?<br>
> Ie: will this work?<br>
> fd = sd_bus_get_fd();<br>
> event_happened = 0;<br>
> poll(fd);<br>
> if (event_happened) sd_bus_process();<br>
> else sd_bus_process(); sd_bus_add_match();<br>
><br>
> It seems it is not working, but i cannot understand if my idea is<br>
> completely wrong or if something else is happening.<br>
> I mean, fd is still the same obviously, i am only telling sd_bus that i'm<br>
> now interested in certain messages, by hooking a callback; am i mistaken?<br>
<br>
</span>I am not sure I follow what you are trying to say.<br>
<br>
But yes, you can add and remove matches on an existing connectio any<br>
time, and you'll get events from the matches from the moment you<br>
install it on until you remove it again (or the connection is<br>
terminated).<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
--<br>
Lennart Poettering, Red Hat<br>
</font></span></blockquote></div><br></div></div>