Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPnPDBObserver: change semantics to get explicit 'deviceAdded' or 'deviceRemoved' calls #13

Open
GoogleCodeExporter opened this issue Sep 8, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I think those "dbUpdated" notification are really cumbersome to handle.

If one wants to know exactly what happend (what device actually was added or 
removed) one has to write extra code to find out. And I think its not too 
uncommon to want to find out the added devices.

Why isn't the Observer told explicitly what device was added or removed? This 
would make client code much much easier to write.

Attached you will find a proposed patch for the UPnPObserver. Note that it is 
not backwards compatible, as it removes the old notifications.
As UPnPDB still has a list of all devices - consumers that are just interested 
in the list, could still just access it, when one of the callbacks is called.

Please note that the same change could also be applied one level deeper 
(SSDPDB). It would make the code in UPnPDB:SSDPDBUpdated much much easier, if 
you didn't have to compare a previous state with the current state, just to 
calculate, what devices where added (and need to download the description) vs. 
the ones removed.

Original issue reported on code.google.com by [email protected] on 17 Jul 2012 at 10:11

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant