[AG-DEV] pyDNSServiceRegister ServiceDiscovery.py issue

Douglas Kosovic douglask at itee.uq.edu.au
Wed Apr 19 02:54:47 CDT 2006


Hi,

The problem is with the glib mainloop that Avahi uses isn't compatible with 
the one that the VenueClient uses. The asynchronous ServiceResolve callbacks 
never get called regardless of if bonjour-py or the native Avahi python API 
is used. Publishing works as no asynchronous callbacks are used.

Looks like I'm going to have to use an external program to return a list of 
service URLs within a specified duration, I'll look into to doing that later 
this week.

I wouldn't mind if None is used for the host-name argument of the 
pyDNSServiceRegister() call in ServiceDiscovery.py for other platforms, as 
an address record for that host is created and Avahi stops producing invalid 
DNS record messages.

> In the pyDNSServiceRegister() call in ServiceDiscovery.py, it is using 
> socket.gethostbyname(socket.gethostname()) which returns an IP address, 
> for the hostname argument. Unfortunately later version of Avahi (the 
> Bonjour compatible package that comes with later linux distributions) 
> doesn't accept IP addresses as valid arguments for the hostname field, it 
> needs to be a hostname resolvable by either DNS or mDNS.
>
> Just wondering if it okay to avoid the issue, by replacing 
> gethostbyname(socket.gethostname()) with None (i.e. NULL, as per Apple's 
> recommendation to use the computer's default host name)? It then works 
> fine with Avahi.
>
> I'm also looking into why __ResolveCallback doesn't get called with Avahi, 
> but __BrowseCallback has no problems, it's odd as the 
> pyDNSServiceResolve() call completes successfully. I may end up just 
> statically linking bonjour-py against Apple's mDNSresponder library if I 
> don't find a solution for the callback

I can't use a static libraries mDNSresponder library as it isn't compatible 
with the IPC for the locally running Avahi daemon.


Cheers,
Doug




More information about the ag-dev mailing list