|
YAACC - UPNP Client and Server
|
How long a play action waits for a receiver the user selected that is not in the registry right now. More...

Classes | |
| interface | Sleeper |
| Sleeps; replaceable so tests do not wait. More... | |
Public Member Functions | |
| int | await (IntSupplier missingCount, IntConsumer beforeWaiting) |
| Looks until no selected receiver is missing, the looks are used up or the thread is interrupted while waiting. | |
Static Public Attributes | |
| static final int | MAX_ATTEMPTS = 3 |
| Total number of looks into the registry, the first one included. | |
| static final long | WAIT_MILLIS = 2500L |
| Wait before look 2 and before look 3. | |
How long a play action waits for a receiver the user selected that is not in the registry right now.
After a suspend the registry may have dropped the renderer (no ssdp:alive could be received) and it is back a moment after a new search, so giving up at once would refuse the play and, worse, drop the receiver from the stored selection.
At most MAX_ATTEMPTS looks in total, WAIT_MILLIS apart (about 5 s), with a chance to start a search before each wait. No Android classes: unit-testable on the JVM. Meant for a worker thread only: await sleeps.
| int de.yaacc.upnp.ReceiverAvailabilityPolicy.await | ( | IntSupplier | missingCount, |
| IntConsumer | beforeWaiting ) |
Looks until no selected receiver is missing, the looks are used up or the thread is interrupted while waiting.
| missingCount | how many selected receivers are not in the registry now |
| beforeWaiting | called with the number of the look that found receivers missing, right before the wait (start a search here); not called after the last look |
Referenced by de.yaacc.upnp.UpnpClient.awaitReceiverDevices().
