WebSocketConnectionWithPing

interface WebSocketConnectionWithPing : WebSocketConnection

Functions

Link copied to clipboard
abstract suspend fun close(code: Int = WebSocketCloseCodes.NORMAL_CLOSURE, reason: String? = null)

Sends a web socket close frame with the given code and reason, and closes the connection.

Link copied to clipboard
abstract suspend fun sendBinary(frameData: ByteArray)

Sends a web socket binary frame.

Link copied to clipboard
abstract suspend fun sendPing(frameData: ByteArray)

Sends a web socket ping frame.

Link copied to clipboard
abstract suspend fun sendText(frameText: String)

Sends a web socket text frame.

Properties

Link copied to clipboard
abstract val canSend: Boolean

If false, sending frames should not be attempted and will likely throw an exception. If true, sending frames will likely succeed. However, no guarantees can be made because there could be a race condition between WS closure and a "send" call.

Link copied to clipboard
open val host: String

The host to which this web socket is connected.

Link copied to clipboard
abstract val incomingFrames: Flow<WebSocketFrame>

The single-consumer hot flow of incoming web socket frames.

Link copied to clipboard
abstract val url: String

The URL that was used to connect this web socket.

Inheritors

Link copied to clipboard

Sources

Link copied to clipboard