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

Tom Cocagne tom.cocagne at gmail.com
Wed Jan 2 20:48:57 MST 2008


    I've recently run into this issue as well Jarek. The easiest solution I
found was to just launch a background 'avahi-publish' subprocess with the
appropriate arguments. Send it a friendly kill signal when you wish to stop
publishing and that's the end of it. It's a linux-specific solution, of
course, but it's dirt simple and avoids the problem of multiple-mdns stacks
on a single machine. If you'd like to support other platforms and/or
non-avahi mdns stacks, it should be fairly straight-forward to write a small
C/Python application for each that does the effectively the same thing.

    Likewise, for browsing services, I've decided to go the route of using
'avahi-browse' to extract the information for me rather than try and
re-implement it directly in Python. Python is so damn friendly, I often
forget that good ol' shell commands can often be the best tool for the job
;-)

    Cheers,

    Tom

On Dec 26, 2007 7:31 AM, Jarek Zgoda <jarek.zgoda at sensisoft.com> wrote:

> 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?
>
> Cheers
> Jarek Zgoda
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20080102/78969502/attachment.html>


More information about the Twisted-Python mailing list