Socket

class Socket

A websocket client implementation.

Constructors

Socket
Link copied to clipboard
fun Socket()

Functions

close
Link copied to clipboard
fun close(code: Short = 1000)

Close a websocket.

connect
Link copied to clipboard
suspend fun connect(url: String, retryDelay: Long = 1000)

Connect to a websocket.

isClosed
Link copied to clipboard
fun isClosed(): Boolean

Returns if a websocket is closed.

receive
Link copied to clipboard
suspend fun receive(): String

Receive a string from a websocket.

send
Link copied to clipboard
fun send(obj: String)

Send string to a websocket.

Properties

state
Link copied to clipboard
val state: Short