fwenzel / ciaociao

A Bonjour/Zeroconf service discovery add-on for Firefox
https://addons.mozilla.org/addon/ciaociao/
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Switch from timeout to permanent listening #9

Open fwenzel opened 8 years ago

fwenzel commented 8 years ago

While the panel is open, we can listen permanently, no reason to stop the background service. Only when closing the panel do we need to switch off the background listener.

Right now, we kill the service after 5 seconds, which sometimes is not enough for initial service detection. On the flip side, the timeout helps us to display a message that no service was found.

Maybe a spinner with "detecting services..." that stays there indefinitely until/unless we find anything?

chrysn commented 8 years ago

i'd dare argue that (at least with avahi) the client could be kept running even when the popup is closed; the presence of new sites since the panel was just shown could then be indicated by an altered world icon (like mail clients have inbox and inbox with unread messages). the cost of having an avahi-browse process running per browser instances seems negligable (it spends most of its running time in an infinite poll syscall, only to wake up if avahi-daemon finds something). the behavior of displaying such a notification could be made optional (in which case the process would only run while the panel is open), but i doubt that would be requested any time soon for performance reasons.

wrt the timeout/"none found" issue, i think that a "no services found yet spinner" that becomes "no services found" 5s after the process start would be fine; an infinite "detecting…" looks odd.

fwenzel commented 8 years ago

Thanks that's all good feedback. I'll take a look at this next time :)

fwenzel commented 6 years ago

I might run the service with increasingly longer intervals and / or add a setting for a user to decide if they want to discover continuously.