YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.client.SnapcastClientServerSwitch Class Reference

What choosing another server for the phone's client does (task 12.10), without Android. More...

Collaboration diagram for de.yaacc.snapcast.client.SnapcastClientServerSwitch:
Collaboration graph

Classes

enum  Action
 What to do with the chosen server. More...
 
enum  Wait
 One step of the wait for the end of the old session. More...
 

Static Public Member Functions

static Action decide (boolean switchedOn, boolean sessionActive, boolean restartPending, String currentHost, String chosenHost)
 
static Wait waitStep (boolean sessionGone, long waitedMs, long maxMs)
 

Detailed Description

What choosing another server for the phone's client does (task 12.10), without Android.

Off: it only changes the next start. On with a session on another server: the session ends and starts again on the new one, once, with the state staying on. The same server: nothing is restarted. On without a session (it gave up, a start was refused): the choice starts the client on the new server. Also the bounded wait between the end of the old session and the new start. Pure.

Member Function Documentation

◆ decide()

static Action de.yaacc.snapcast.client.SnapcastClientServerSwitch.decide ( boolean switchedOn,
boolean sessionActive,
boolean restartPending,
String currentHost,
String chosenHost )
static
Parameters
switchedOnthe stored state of the client
sessionActivea session starts, runs or reconnects
restartPendingan earlier choice is still waiting for the end of the old session
currentHostthe server the client uses now (null or empty when none)
chosenHostthe server the user chose

Referenced by de.yaacc.snapcast.client.SnapcastClientPower.chooseServer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitStep()

static Wait de.yaacc.snapcast.client.SnapcastClientServerSwitch.waitStep ( boolean sessionGone,
long waitedMs,
long maxMs )
static
Parameters
sessionGonethe session and the service instance of the old session are gone
waitedMshow long the restart has waited
maxMsthe longest wait: a teardown that never ends must not hold the choice for ever

The documentation for this class was generated from the following file: