Class SfuSocket
-
- All Implemented Interfaces:
public final class SfuSocket extends PersistentSocket<JoinCallResponseEvent>
The SFU socket is slightly different from the coordinator socket It sends a JoinRequest to authenticate SFU socket uses binary instead of text
-
-
Field Summary
Fields Modifier and Type Field Description private LongreconnectTimeoutprivate final MutableSharedFlow<VideoEvent>eventsprivate final MutableSharedFlow<Throwable>errorsprivate final StateFlow<SocketState>connectionStateprivate final StateFlow<String>connectionIdprivate CancellableContinuation<JoinCallResponseEvent>connected
-
Constructor Summary
Constructors Constructor Description SfuSocket(String url, String sessionId, String token, SuspendFunction0<String> getSubscriberSdp, CoroutineScope scope, OkHttpClient httpClient, NetworkStateProvider networkStateProvider, SuspendFunction0<Unit> onFastReconnected)
-
Method Summary
Modifier and Type Method Description final JoinCallResponseEventconnectMigrating(SuspendFunction0<<Error class: unknown class>> migration, Function1<CancellableContinuation<JoinCallResponseEvent>, Unit> invocation)JoinCallResponseEventconnect(Function1<CancellableContinuation<JoinCallResponseEvent>, Unit> invocation)Connect the socket, authenticate, start the healthmonitor and see if the network is online Unitauthenticate()UnitonMessage(WebSocket webSocket, ByteString bytes)Invoked when a binary (type 0x2) message has been received.-
Methods inherited from class io.getstream.video.android.core.socket.PersistentSocket
cleanup, disconnect, getConnected, getConnectionId, getConnectionState, getErrors, getEvents, getReconnectTimeout, onClosed, onClosing, onFailure, onInternetConnected, onInternetDisconnected, onOpen, reconnect, setConnected, setReconnectTimeout -
Methods inherited from class okhttp3.WebSocketListener
onMessage -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SfuSocket
SfuSocket(String url, String sessionId, String token, SuspendFunction0<String> getSubscriberSdp, CoroutineScope scope, OkHttpClient httpClient, NetworkStateProvider networkStateProvider, SuspendFunction0<Unit> onFastReconnected)
-
-
Method Detail
-
connectMigrating
final JoinCallResponseEvent connectMigrating(SuspendFunction0<<Error class: unknown class>> migration, Function1<CancellableContinuation<JoinCallResponseEvent>, Unit> invocation)
-
connect
JoinCallResponseEvent connect(Function1<CancellableContinuation<JoinCallResponseEvent>, Unit> invocation)
Connect the socket, authenticate, start the healthmonitor and see if the network is online
-
authenticate
Unit authenticate()
-
-
-
-