Package io.getstream.video.android.core
Class CallHealthMonitor
-
- All Implemented Interfaces:
public final class CallHealthMonitorMonitors
Publisher and subscriber Peer connection states -> immediately reconnect
Network up/down -> mark down instantly when down. reconnect when up
Interval every 2 seconds. check and decide what to do
Calls call.reconnectOrSwitchSfu() when needed
Notes
There is a delay after a restart till connections show healthy again
So we shouldn't immediately try to reconnect if we're already reconnecting
-
-
Field Summary
Fields Modifier and Type Field Description private final List<PeerConnection.PeerConnectionState>badStatesprivate final List<PeerConnection.PeerConnectionState>badStatesExcludingClosedprivate final List<PeerConnection.PeerConnectionState>goodStatesprivate final Callcallprivate final CoroutineScopecallScopeprivate final Function0<Unit>onIceRecoveryFailed
-
Constructor Summary
Constructors Constructor Description CallHealthMonitor(Call call, CoroutineScope callScope, Function0<Unit> onIceRecoveryFailed)
-
Method Summary
Modifier and Type Method Description final List<PeerConnection.PeerConnectionState>getBadStates()final List<PeerConnection.PeerConnectionState>getBadStatesExcludingClosed()final List<PeerConnection.PeerConnectionState>getGoodStates()final CallgetCall()final CoroutineScopegetCallScope()final Function0<Unit>getOnIceRecoveryFailed()final Unitstart()final Unitstop()final UnitstopTimer()final Unitcheck()Checks the peer connection states. final Unitreconnect(Boolean forceRestart)Only 1 reconnect attempt runs at the same time Will skip if we already tried to reconnect less than reconnectDebounceMs ms ago -
-
Method Detail
-
getBadStates
final List<PeerConnection.PeerConnectionState> getBadStates()
-
getBadStatesExcludingClosed
final List<PeerConnection.PeerConnectionState> getBadStatesExcludingClosed()
-
getGoodStates
final List<PeerConnection.PeerConnectionState> getGoodStates()
-
getCallScope
final CoroutineScope getCallScope()
-
getOnIceRecoveryFailed
final Function0<Unit> getOnIceRecoveryFailed()
-
check
@Synchronized() final Unit check()
Checks the peer connection states. Launches reconnect() if not healthy
-
-
-
-