Ticket #233 (new defect)

Opened 4 years ago

Last modified 5 months ago

Bonjour compatibility layer - Synchronous DNSServiceResolve behaviour not present

Reported by: hwang Owned by: lennart
Milestone: Component: avahi-compat-libdns_sd
Keywords: synchronous resolve, DNSServiceResolve, DNSServiceProcessResult Cc: acfoltzer@…

Description

In Resolving the Current Address of a Service section of DNS Service Discovery Programming Guide by Apple:

If you want to run the callback function synchronously instead of setting up a run loop or a select loop, you can call DNSServiceResolve and immediately call DNSServiceProcessResult. The DNSServiceProcessResult function will block until the mDNSResponder daemon has a response, at which time the callback specified when DNSServiceResolve was called will be invoked.

This behaviour does not seem to work with the Bonjour compatibility layer; instead, the DNSServiceProcessResult function returns immediately with a value of 0 (no error) and the callback function is not called.

I am using Ubuntu 8.04 (x86) with libavahi-compat-libdnssd-dev version 0.6.22-2ubuntu4 package.

Attachments

test.c (0.6 kB) - added by acfoltzer 5 months ago.

Change History

Changed 5 months ago by acfoltzer

Changed 5 months ago by acfoltzer

I can confirm the same problem with DNSServiceBrowse's callback not being invoked when using DNSServiceProcessResult synchronously. See my example program here: http://stackoverflow.com/questions/7391079/avahi-dns-sd-compatibility-layer-fails-to-run-browse-callback

This is on Ubuntu 11.04 with libavahi-compat-libdnssd1 0.6.30-0ubuntu2.

I realize the native API is favored over this compatibility library, but it's still very helpful to have a cross-platform target. Thanks!

Changed 5 months ago by acfoltzer

  • cc acfoltzer@… added
Note: See TracTickets for help on using tickets.