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 | 0 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 your are welcome to comment on your own blog instead.