|
YAACC - UPNP Client and Server
|
The services that wait to be resolved. More...

Classes | |
| class | Pending |
| A service that waits for, or is in, resolution. | |
Public Member Functions | |
| ResolveQueue (MonotonicClock clock, long timeoutMillis, int capacity) | |
| synchronized boolean | offer (String name, T item) |
| Queues a service. | |
| synchronized Pending< T > | next () |
| The service to resolve now, or null when one is being resolved (and has time left) or none waits. | |
| synchronized void | done (Pending< T > pending) |
| The resolution that was started with this entry ended (answer or failure). | |
| synchronized void | done (String name) |
| The resolution of this name ended (answer or failure); an answer for any other name is ignored. | |
| synchronized void | clear () |
| Forgets everything (discovery stopped). | |
| synchronized int | size () |
The services that wait to be resolved.
Android's NsdManager resolves one service at a time (a second request fails with "already active"), a resolution can stay unanswered, and a hostile network can announce any number of names. So: a bounded first-in-first-out queue, one active entry, the same name queued once, and an active entry that was not answered within the timeout is given up. Pure; the thin Android wrapper only asks it what to do.
| <T> | what the wrapper needs to start a resolution (the service info object) |
| synchronized void de.yaacc.multiroom.discovery.ResolveQueue< T >.done | ( | Pending< T > | pending | ) |
The resolution that was started with this entry ended (answer or failure).
Only the entry that is active now is cleared: the late answer of a resolution that was dropped (the discovery was stopped, or the timeout gave it up) must not clear a newer resolution of the same name.
| synchronized Pending< T > de.yaacc.multiroom.discovery.ResolveQueue< T >.next | ( | ) |
| synchronized boolean de.yaacc.multiroom.discovery.ResolveQueue< T >.offer | ( | String | name, |
| T | item ) |
Queues a service.
A name that is queued already gets the newer item; a name that is being resolved is not queued again.