レナート   PID EINS!   ﻟﻴﻨﺎﺭﺕ

Mon, 22 Aug 2005

Avahi 0.1 Finally Released

We finally released Avahi 0.1. Full release announcement here. Avahi comes with a powerful DBUS API. Just two show off the coolnes of that interface a Python example:

import avahi, dbus, gobject

bus = dbus.SystemBus()
server = dbus.Interface(bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)

def new_service(interface, protocol, name, type, domain):
	print "Found service '%s' of type '%s' in domain '%s'" % (name, type, domain)

def remove_service(interface, protocol, name, type, domain):
	print "Service '%s' of type '%s' in domain '%s' disappeared." % (name, type, domain)

path = server.ServiceBrowserNew(avahi.IF_UNSPEC, avahi.PROTO_UNSPEC, "_http._tcp", "")
b = dbus.Interface(bus.get_object(avahi.DBUS_NAME, path), avahi.DBUS_INTERFACE_SERVICE_BROWSER)
b.connect_to_signal('ItemNew', new_service)
b.connect_to_signal('ItemRemove', remove_service)
gobject.MainLoop().run()

This short program will connect to running avahi-daemon and browse for web services.

posted at: 00:54 | path: /projects | permanent link to this entry | comments


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored you are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013

Valid XHTML 1.0 Strict!   Valid CSS!