Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun connect(connectData: ConnectData)

Connect the user.

Link copied to clipboard
abstract fun connectionId(): StateFlow<String?>

Get the connection id.

Link copied to clipboard
abstract suspend fun disconnect()

Disconnect the socket.

Link copied to clipboard
abstract fun errors(): Flow<Error>

Socket errors as Flow

Link copied to clipboard
abstract fun events(): Flow<EventOut>

Socket events as Flow

Link copied to clipboard
abstract suspend fun reconnect(data: ConnectData, force: Boolean = false)

Reconnect the user to the socket.

Link copied to clipboard
abstract fun sendData(data: String)

Send raw data to the socket. If you already have a parsed event that can be sent.

Link copied to clipboard
abstract suspend fun sendEvent(event: EventIn): Boolean

Send event to the socket.

Link copied to clipboard
abstract fun state(): StateFlow<State>

State of the socket as StateFlow

Link copied to clipboard
abstract fun updateToken(token: Token)

Update the token from the outside.

Link copied to clipboard
abstract fun whenConnected(connectionTimeout: Long = DEFAULT_SOCKET_TIMEOUT, connected: suspend (connectionId: String) -> Unit)

When connected to the socket.