WebSocket

open external class WebSocket(url: String, protocols: dynamic = definedExternally) : EventTarget(source)

Exposes the JavaScript WebSocket to Kotlin

Since Kotlin

1.1

Constructors

Link copied to clipboard
constructor(url: String, protocols: dynamic = definedExternally)

Types

Link copied to clipboard
object Companion
Since Kotlin 1.1

Properties

Link copied to clipboard
Since Kotlin 1.1
Link copied to clipboard
Since Kotlin 1.1
Link copied to clipboard
open val extensions: String
Since Kotlin 1.1
Link copied to clipboard
var onclose: (Event) -> dynamic?
Since Kotlin 1.1
Link copied to clipboard
var onerror: (Event) -> dynamic?
Since Kotlin 1.1
Link copied to clipboard
var onmessage: (MessageEvent) -> dynamic?
Since Kotlin 1.1
Link copied to clipboard
var onopen: (Event) -> dynamic?
Since Kotlin 1.1
Link copied to clipboard
open val protocol: String
Since Kotlin 1.1
Link copied to clipboard
open val readyState: Short
Since Kotlin 1.1
Link copied to clipboard
open val url: String
Since Kotlin 1.1

Functions

Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun addEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
Since Kotlin 1.1
Link copied to clipboard
fun close(code: Short = definedExternally, reason: String = definedExternally)
Since Kotlin 1.1
Link copied to clipboard
Since Kotlin 1.1
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
Since Kotlin 1.1
Link copied to clipboard
fun send(data: String)
fun send(data: ArrayBuffer)
fun send(data: Blob)
Since Kotlin 1.1