WebSocket

JS
1.1
open class WebSocket : EventTarget

Exposes the JavaScript WebSocket to Kotlin

Constructors

JS
1.1

<init>

Exposes the JavaScript WebSocket to Kotlin

WebSocket(
    url: String,
    protocols: dynamic = definedExternally)

Properties

JS
1.1

binaryType

var binaryType: BinaryType
JS
1.1

bufferedAmount

open val bufferedAmount: Int
JS
1.1

extensions

open val extensions: String
JS
1.1

onclose

var onclose: (Event) -> dynamic
JS
1.1

onerror

var onerror: (Event) -> dynamic
JS
1.1

onmessage

var onmessage: (Event) -> dynamic
JS
1.1

onopen

var onopen: (Event) -> dynamic
JS
1.1

protocol

open val protocol: String
JS
1.1

readyState

open val readyState: Short
JS
1.1

url

open val url: String

Functions

JS
1.1

close

fun close(
    code: Short = definedExternally,
    reason: String = definedExternally)
JS
1.1

send

fun send(data: String)
fun send(data: Blob)
fun send(data: ArrayBuffer)
fun send(data: ArrayBufferView)

Companion Object Properties

JS
1.1

CLOSED

val CLOSED: Short
JS
1.1

CLOSING

val CLOSING: Short
JS
1.1

CONNECTING

val CONNECTING: Short
JS
1.1

OPEN

val OPEN: Short