Implementation(Browser *master, Context *ctx) : master_(master) , browser_(NULL) { AvahiClient *client = (AvahiClient*)ctx->context(); // Create the service browser. browser_ = avahi_service_browser_new( client, // AVAHI_IF_UNSPEC, // any interface AVAHI_PROTO_UNSPEC, // any protocol master_->serviceType(), // service type ("_http._tcp") NULL, // default domain (".local") (AvahiLookupFlags)0, sBrowseCallback, this); if (!browser_) { throw dub::Exception("Failed to create service browser (%s).\n", avahi_strerror(avahi_client_errno(client))); } }