Socket

class Socket

A websocket client implementation.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Functions

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

Close a websocket.

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

Connect to a websocket.

Link copied to clipboard

Returns if a websocket is closed.

Link copied to clipboard
suspend fun receive(): String

Receive a string from a websocket.

Link copied to clipboard
fun send(obj: String)

Send string to a websocket.