[AG-DEV] pyDNSServiceRegister ServiceDiscovery.py issue
Douglas Kosovic
douglask at itee.uq.edu.au
Wed Apr 12 03:23:23 CDT 2006
Hi,
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
Thanks,
Doug
More information about the ag-dev
mailing list