Socket

open class Socket(baseUrl: String, protocols: Array<out String>)

Socket defines how to connect via websocket. Therefore it needs an baseUrl and an optional list of protocols. The Session will be established after calling the connect method.

Constructors

Socket
Link copied to clipboard
js
fun Socket(baseUrl: String = "", protocols: Array<out String> = emptyArray())

Functions

append
Link copied to clipboard
js
fun append(subUrl: String): Socket
Appends the given subUrl to the baseUrl and returns a new instance of Socket.
connect
Link copied to clipboard
js
fun connect(subUrl: String = ""): Session
Creates a Session by trying to connect to the websocket endpoint.
protocols
Link copied to clipboard
js
fun protocols(vararg protocols: String): Socket
sets or overrides the given list of protocols for the Socket and returns a new instance of Socket.