Enumeration that defines the state of a StreamLink connection to a Liberator.
You can obtain the ConnectionState
by calling getConnectionState
on a caplin.streamlink.ConnectionStatusEvent.
Although hints regarding possible transitions between ConnectionState
s are given, you should not imply that this is a strict contract because network conditions may cause undocumented transitions.
The generalised sequence after calling streamlink.connect()
is as follows: CONNECTING
-> CONNECTED
-> LOGGEDIN
. At any point in time the connection could be lost which would raise the LOST
, at this point StreamLink would attempt to connect again to a Liberator server, starting the sequence once more.
With this in mind, it is possible to map these onto a "traffic light" component indicating connection health using the following mappings:
DISCONNECTED
LOGGEDIN
ConnectionState
s. Attributes | Name and Description |
---|---|
| caplin.streamlink.ConnectionState() |
Attributes | Name and Description |
---|---|
<static> | caplin.streamlink.ConnectionState.CONNECTED A network connection has been established to the Liberator. |
<static> | caplin.streamlink.ConnectionState.CONNECTING A connection attempt is in progress. |
<static> | caplin.streamlink.ConnectionState.CREDENTIALSRETRIEVALFAILED StreamLink has failed to retrieve the credentials. |
<static> | caplin.streamlink.ConnectionState.CREDENTIALSRETRIEVED StreamLink has successfully retrieved the credentials. |
<static> | caplin.streamlink.ConnectionState.DISCONNECTED Disconnected from the Liberator. |
<static> | caplin.streamlink.ConnectionState.EJECTED The client has been ejected from the Liberator. |
<static> | caplin.streamlink.ConnectionState.FAILED A connection attempt has failed. |
<static> | caplin.streamlink.ConnectionState.LOGGEDIN The client is now logged into the Liberator. |
<static> | caplin.streamlink.ConnectionState.LOGINFAILED The client could not login to the Liberator. |
<static> | caplin.streamlink.ConnectionState.LOST The connection to the Liberator has been lost. |
<static> | caplin.streamlink.ConnectionState.PAUSED The connection has been paused by the application. |
<static> | caplin.streamlink.ConnectionState.RECONNECTED The Liberator session has been reconnected. |
<static> | caplin.streamlink.ConnectionState.RETRIEVINGCREDENTIALS StreamLink is attempting to obtain a set of credentials to log in to the server. |
<static> | caplin.streamlink.ConnectionState.UNREACHABLE A connection to the Liberator is not possible due to no network being available. |
► caplin.streamlink.ConnectionState()
► <static> caplin.streamlink.ConnectionState.CONNECTED
A network connection has been established to the Liberator. StreamLink will now attempt to log in to the Liberator session.
► <static> caplin.streamlink.ConnectionState.CONNECTING
A connection attempt is in progress. If the connection attempt is successful, a CONNECTED
state will be raised, if the connection fails, the FAILED
event will be raised.
► <static> caplin.streamlink.ConnectionState.CREDENTIALSRETRIEVALFAILED
StreamLink has failed to retrieve the credentials.
► <static> caplin.streamlink.ConnectionState.CREDENTIALSRETRIEVED
StreamLink has successfully retrieved the credentials.
► <static> caplin.streamlink.ConnectionState.DISCONNECTED
Disconnected from the Liberator. When this state is raised by the StreamLink library all subscriptions have removed. StreamLink will not perform any activity until you call connect()
on the caplin.streamlink.StreamLink object.
► <static> caplin.streamlink.ConnectionState.EJECTED
The client has been ejected from the Liberator. StreamLink will not perform any more connection attempts and will switch to the DISCONNECTED
state.
► <static> caplin.streamlink.ConnectionState.FAILED
A connection attempt has failed. StreamLink will attempt to connect to a Liberator on the configured server list.
► <static> caplin.streamlink.ConnectionState.LOGGEDIN
The client is now logged into the Liberator. In this state it is possible for StreamLink applications to receive subscription updates and receive responses to commands.
► <static> caplin.streamlink.ConnectionState.LOGINFAILED
The client could not login to the Liberator. StreamLink will not perform any more connection attempts and will switch to the DISCONNECTED
state.
► <static> caplin.streamlink.ConnectionState.LOST
The connection to the Liberator has been lost. StreamLink will attempt to connect and establish a new session with a configured Liberator.
► <static> caplin.streamlink.ConnectionState.PAUSED
The connection has been paused by the application. This state is a direct result of the application causing caplin.streamlink.StreamLink.pause. StreamLink is held in a "frozen" state pending a call to caplin.streamlink.StreamLink.resume.
► <static> caplin.streamlink.ConnectionState.RECONNECTED
The Liberator session has been reconnected. This should be treated as an informational event, StreamLink will switch to the LOGGEDIN
state to simplify implementation of your application (see the traffic light example above).
► <static> caplin.streamlink.ConnectionState.RETRIEVINGCREDENTIALS
StreamLink is attempting to obtain a set of credentials to log in to the server.
► <static> caplin.streamlink.ConnectionState.UNREACHABLE
A connection to the Liberator is not possible due to no network being available.