-
Notifications
You must be signed in to change notification settings - Fork 16
Understanding Avahi
When publish a service, you may wish to publish across more than one service name/type. For example printers may be publishing a unix printer service, pdl printer service, scanner service etc. For such services it is important for their publication to be commited atomically as a group so that no other service publication can interrupt and destroy the commonality of the service name.
This is what the entry group is for - add your service group to the object and they'll all get published together.
Note that this means for most services (one-offs), you'll be using an entry group per publication. Do not try and re-use the entry group - avahi will go into a bad state!
When discovering, you'll need to set up a resolver for each discovery. This resolver should be kept open, so that you can be informed of when the connection goes up and down. Connections going up and down don't remove the discovery, just its resolvability. Things of course get complicated when you drop off, and someone else steals your name.