[avahi] Client Browser questions

Nathanael D. Noblet nathanael at gnat.ca
Tue Apr 12 22:39:51 PDT 2011


On 04/11/2011 09:13 AM, Nathanael D. Noblet wrote:
> Hello,
>
> So using the examples from the source in avahi I've been able to get my
> one app to see when a new service comes online that I'm interested in.
> However I'm confused about the other use-case, mainly when a client goes
> offline. It doesn't provide enough information to know which host
> disappeared...
>
>  From the example browse_callback you get the event (failure, new,
> remove etc) in the case of new you resolve it to a host. Is there any
> way in the REMOVE case to determine the source (IP, hostname or any
> other identifying). The reason being is that my app is an
> 'administration' app, so has a list of configured hosts, and avahi is
> used to know when they are accessible. So when a host starts the service
> I can see it and in my host list I mark it as 'online' but when I cancel
> the service, I can't see a way to mark that host as offline.

So I poked around avahi-discover and got some good ideas so this is all 
working now.

I do however have one more question...

My app registers a service browser looking for one type of service. That 
all works well. The part that doesn't is if my app comes up after a 
client publishing that service. To reproduce here's what I do...


    Browser              |    Client
========================|===========================
Start Browser App       |
                         | Start published service
App sees it             |
                         | Stop published service
App sees it removed     |
                         | Start published service
App sees it             |
Close app               |
Wait a bit              |
                         |
Start Browser App       |
                         |
Receive resolve failure |


How do I fix it so that it still resolves? I'll keep poking around to 
see what other apps do, but thought I'd ask.


-- 
Nathanael d. Noblet
t 403.875.4613


More information about the avahi mailing list