Re: Moving to bonjour over howl

On Tue, 2005-09-20 at 00:59 +0200, Lennart Poettering wrote:
> Yes, it's ugly to support synchronous operation on top of mDNS optimally. But
> that's the way it is. 

I think you're sort of misguided at how this currently works, and not
very good at describing exactly how your optimal solution works. Let me
describe in exact detail how this actually works with the current
gnome-vfs + howl solution:

The howl daemon is always running, and all queries clients done happen
through it.

The first time an application that uses gnome-vfs calls
gnome_vfs_open_directory (or gnome_vfs_async_load_directory) on
dns-sd://local/ (which will do a query for interesting fileshares using
mDNS) we:
1) start long running queries in the background
2) do a "synchronous" browse query
3) Collect responses from both these callbacks and store in global state
4) After 200 msecs, cancel the query in 2)
5) return a list of results based on the global state

On any subsequent call to gnome_vfs_open_directory() we immediately
return the list from the global state, which is constantly kept
up-to-date by the query started in 1).

If the application adds a monitor using gnome_vfs_monitor_add() on
dns-sd://local/ the monitor will be called with ADDS and DELETES as we
get responses to query 1. All "normal" gnome-vfs UI apps like Nautilus
and the file selector do this.

This is all done in each client, however, since the query will be
constantly active for as long as any process that has accessed
dns-sd://local/ once, howl should be able to cache all the results from
it. (If its smart enough to notice that a new query is identical to an
already running query and share them.)

This gives us:
* Nice "normal" async mDNS dns-sd for normal apps, with only a 200 msec
  delay the first time an app reads dns-sd://local/
* A mostly working sync-only readdir call for odd things like
* Basically no unnecessary queries sent on the network. 
  (Assuming howl is smart, but even if its not, at most one query per
   gnome-vfs app that reads dns-sd://local/, which in practice is only
   done by Nautilus.)

What part of this do you think is non-optimal, and how would you do it

 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a short-sighted Catholic Green Beret with a mysterious suitcase 
handcuffed to his arm. She's a provocative Bolivian college professor looking 
for love in all the wrong places. They fight crime! 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]