Avahi can be difficult to grok... I just went through this transition and it was not easy due to missing docs for low level stuff such as the PollApi.<div><br></div><div>Here is some advice depending on your situation:</div>
<div><br></div><div>A. You want to avoid creating new threads and use your own select/poll:</div><div><br></div><div>You have to create a AvahiWatch and AvahiTimer classes that will insert file descriptors into your event loop. See <a href="http://avahi.sourcearchive.com/documentation/0.6.10/qt-watch_8cpp-source.html">poll API for Qt</a> or <a href="https://github.com/lubyk/lubyk/tree/master/modules/mdns/core">Lua bindings for lubyk</a> (has both mac and linux code) as examples.</div>
<div><br></div><div>B. You can live with some extra threads:</div><div><br></div><div>Use the <span style="background-color:rgb(255,255,255);font-size:13px"><a href="http://avahi.org/wiki/RunningAvahiClientAsThread">AvahiThreadedPoll</a> to run avahi in its own event loop.</span></div>
<div><span style="background-color:rgb(255,255,255);font-size:13px"><br></span></div><div><span style="background-color:rgb(255,255,255);font-size:13px">C. You use Qt or Glib as event loop: you can use </span>libavahi-qt and libavahi-glib respectively.</div>
<div><br></div><div>Good luck.</div><div><br></div><div>Gaspard<br><br><div class="gmail_quote">On Tue, Feb 21, 2012 at 1:31 AM, Kirk Reistroffer <span dir="ltr">&lt;<a href="mailto:kreistroffer@kace.com">kreistroffer@kace.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>
<div>I have a Bonjour-aware service in development and running on OSX and Windows.  I&#39;m currently moving it onto Linux flavors and am looking for advice on how best to proceed with that.</div>
<div><br>
</div>
<div>It appears that Avahi is a preferred Linux native zeroconf implementation and I see that there&#39;s been some collaboration between Apple and the Avahi project in the past, leading to an Avahi supplied replacement dns_sd.h and an avahi-compat-libdns_sd library.
  I&#39;m looking for information on how to initially make use of the compatibility library.  I&#39;m expecting that I&#39;ll eventually need to re-implement the zeroconf parts of the app to the Avahi API on Linux but hope to more immediately get a Linux build that plays
 well/ok with its peers for POC.</div>
<div><br>
</div>
<div>I haven&#39;t yet found a spot on <a href="http://www.avahi.org" target="_blank">www.avahi.org</a> that describes how to build the first step.  I&#39;ve substituted the Avahi dns_sd.h (which appears to be a subset of Apple&#39;s dns_sd.h) and link with libavahi-common.so.  I&#39;ve tried:</div>

<div>
<div>&gt; sudo apt-get install libavahi-compat-libdnssd1</div>
</div>
<div>That appears to be a source download and I&#39;m trying to get all of its dependencies via ./configure in its avahi-0.6.31 directory. I&#39;m guessing that will eventually get me a libavahi-compat-libdnssd1.so to add to my app link.</div>

<div>It seems that the standard Avahi .so&#39;s are pre-installed in Ubuntu 11 but the compatibility libraries aren&#39;t so I think I have to build it locally and add it to /usr/lib with the other libavahi-*.so files.  Am I on the right track?</div>

<div><br>
</div>
<div><br>
</div>
</div>
</div>

<br>_______________________________________________<br>
avahi mailing list<br>
<a href="mailto:avahi@lists.freedesktop.org">avahi@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/avahi" target="_blank">http://lists.freedesktop.org/mailman/listinfo/avahi</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>                                                               Gaspard</div><br>
</div>