[Twisted-Python] Twisted apps + zeroconf, anyone?

Jarek Zgoda jarek.zgoda at sensisoft.com
Thu Dec 27 03:22:56 EST 2007

Jean-Paul Calderone napisał(a):

>> I'd like to add auto-discovery feature to my (Twisted) application and I
>> thought I'll use zeroconf to advertize the service to clients in local
>> network. I decided on zeroconf, because the app is a webservice that
>> has to
>> be accessible to multitude of various clients. Unfortunately, the only
>> one
>> library I found barely usable with Twisted is PyZeroconf (the other is
>> avahi, but it seems too tightly bound to gobject to be usable with
>> Twisted). Is this all or I do not know how to use google?
>> Anybody can share any hints on this? Is this feasible idea or there are
>> better ways to achieve what I want?
> There is only supposed to be one process on a system taking care of
> zeroconf
> publications.  This means that it is more likely that you will want your
> app
> to talk to some existing zeroconf software.  For example, on Linux, avahi.
> This means that for most practical purposes, you don't actually want to
> talk
> mdns.  You want to talk to avahi (or to something on OS X, or to something
> on Windows).
> This doesn't mean it wouldn't be cool to have a very Twisted-friendly zero-
> conf library.  But it does mean that for practical purposes, that's usually
> not what you want.

I do not want to run my own mDNS service, I just want to advertize
(publish) my webservice in running instance of mDNS. I think it would be
Avahi mDNS/SD in most cases, but I cann't be sure now.

The PyZeroconf library has many global state objects so I think it's not
well suited for any forking environment. Python-avahi looks far better,
but it requires gobject-based main loop to be used asynchronously (other
way it can not connect to DBus signals). Itamar's module (mentioned by
Thomas) seems to be perfect fit my needs if only I'd be able to
implement service publishing part (discovery and browsing works well,
after adapting the code to Twisted 2.5 layout). ;)

Jarek Zgoda
Skype: jzgoda | GTalk: zgoda at jabber.aster.pl | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

More information about the Twisted-Python mailing list