WebSocket

Overview

The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

Location

 

addEventListener (dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(partype: dynamic; parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

func addEventListener(_ partype: dynamic, _ parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

Sub addEventListener(partype As dynamic, parlistener As dynamic)

Parameters:

  • partype:
  • parlistener:

addEventListener (dynamic, dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

Sub addEventListener(type As dynamic, listener As dynamic, options As dynamic)

Parameters:

  • type:
  • listener:
  • options:

addEventListener (dynamic, dynamic, Boolean)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

Sub addEventListener(type As dynamic, listener As dynamic, useCapture As Boolean)

Parameters:

  • type:
  • listener:
  • useCapture:

binaryType

 

property binaryType: String read write;

 

String binaryType { get; set; }

 

var binaryType: String { get{} set{} }

 

String binaryType { __get; __set; }

 

Property binaryType() As String

bufferedAmount

 

property bufferedAmount: Double read;

 

Double bufferedAmount { get; }

 

var bufferedAmount: Double { get{} }

 

Double bufferedAmount { __get; }

 

ReadOnly Property bufferedAmount() As Double

close

The WebSocket.close() method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.

 

method close(code: Int32; reason: dynamic)

 

void close(Int32 code, dynamic reason)

 

func close(_ code: Int32, _ reason: dynamic)

 

void close(Int32 code, dynamic reason)

 

Sub close(code As Int32, reason As dynamic)

Parameters:

  • code:
  • reason:

extensions

 

property extensions: String read;

 

String extensions { get; }

 

var extensions: String { get{} }

 

String extensions { __get; }

 

ReadOnly Property extensions() As String

onclose

 

property onclose: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onclose { get; set; }

 

var onclose: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onclose { __get; __set; }

 

Property onclose() As WebAssemblyDelegate

onerror

 

property onerror: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onerror { get; set; }

 

var onerror: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onerror { __get; __set; }

 

Property onerror() As WebAssemblyDelegate

onmessage

 

property onmessage: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onmessage { get; set; }

 

var onmessage: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onmessage { __get; __set; }

 

Property onmessage() As WebAssemblyDelegate

onopen

 

property onopen: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onopen { get; set; }

 

var onopen: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onopen { __get; __set; }

 

Property onopen() As WebAssemblyDelegate

protocol

 

property protocol: String read;

 

String protocol { get; }

 

var protocol: String { get{} }

 

String protocol { __get; }

 

ReadOnly Property protocol() As String

readyState

 

property readyState: Byte read;

 

Byte readyState { get; }

 

var readyState: Byte { get{} }

 

Byte readyState { __get; }

 

ReadOnly Property readyState() As Byte

removeEventListener    (declared in EventTarget)

Removes an event listener from the EventTarget.

 

method removeEventListener(partype: dynamic; parlistener: dynamic; paroptions: dynamic; paruseCapture: dynamic): dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

func removeEventListener(_ partype: dynamic, _ parlistener: dynamic, _ paroptions: dynamic, _ paruseCapture: dynamic) -> dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

Function removeEventListener(partype As dynamic, parlistener As dynamic, paroptions As dynamic, paruseCapture As dynamic) As dynamic

Parameters:

  • partype:
  • parlistener:
  • paroptions:
  • paruseCapture:

send

The WebSocket.send() method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

 

method send(data: dynamic)

 

void send(dynamic data)

 

func send(_ data: dynamic)

 

void send(dynamic data)

 

Sub send(data As dynamic)

Parameters:

  • data:

url

 

property url: String read;

 

String url { get; }

 

var url: String { get{} }

 

String url { __get; }

 

ReadOnly Property url() As String

 

binaryType

 

property binaryType: String read write;

 

String binaryType { get; set; }

 

var binaryType: String { get{} set{} }

 

String binaryType { __get; __set; }

 

Property binaryType() As String

bufferedAmount

 

property bufferedAmount: Double read;

 

Double bufferedAmount { get; }

 

var bufferedAmount: Double { get{} }

 

Double bufferedAmount { __get; }

 

ReadOnly Property bufferedAmount() As Double

extensions

 

property extensions: String read;

 

String extensions { get; }

 

var extensions: String { get{} }

 

String extensions { __get; }

 

ReadOnly Property extensions() As String

onclose

 

property onclose: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onclose { get; set; }

 

var onclose: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onclose { __get; __set; }

 

Property onclose() As WebAssemblyDelegate

onerror

 

property onerror: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onerror { get; set; }

 

var onerror: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onerror { __get; __set; }

 

Property onerror() As WebAssemblyDelegate

onmessage

 

property onmessage: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onmessage { get; set; }

 

var onmessage: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onmessage { __get; __set; }

 

Property onmessage() As WebAssemblyDelegate

onopen

 

property onopen: WebAssemblyDelegate read write;

 

WebAssemblyDelegate onopen { get; set; }

 

var onopen: WebAssemblyDelegate { get{} set{} }

 

WebAssemblyDelegate onopen { __get; __set; }

 

Property onopen() As WebAssemblyDelegate

protocol

 

property protocol: String read;

 

String protocol { get; }

 

var protocol: String { get{} }

 

String protocol { __get; }

 

ReadOnly Property protocol() As String

readyState

 

property readyState: Byte read;

 

Byte readyState { get; }

 

var readyState: Byte { get{} }

 

Byte readyState { __get; }

 

ReadOnly Property readyState() As Byte

url

 

property url: String read;

 

String url { get; }

 

var url: String { get{} }

 

String url { __get; }

 

ReadOnly Property url() As String

 

addEventListener (dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(partype: dynamic; parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

func addEventListener(_ partype: dynamic, _ parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

Sub addEventListener(partype As dynamic, parlistener As dynamic)

Parameters:

  • partype:
  • parlistener:

addEventListener (dynamic, dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

Sub addEventListener(type As dynamic, listener As dynamic, options As dynamic)

Parameters:

  • type:
  • listener:
  • options:

addEventListener (dynamic, dynamic, Boolean)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

Sub addEventListener(type As dynamic, listener As dynamic, useCapture As Boolean)

Parameters:

  • type:
  • listener:
  • useCapture:

close

The WebSocket.close() method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.

 

method close(code: Int32; reason: dynamic)

 

void close(Int32 code, dynamic reason)

 

func close(_ code: Int32, _ reason: dynamic)

 

void close(Int32 code, dynamic reason)

 

Sub close(code As Int32, reason As dynamic)

Parameters:

  • code:
  • reason:

removeEventListener    (declared in EventTarget)

Removes an event listener from the EventTarget.

 

method removeEventListener(partype: dynamic; parlistener: dynamic; paroptions: dynamic; paruseCapture: dynamic): dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

func removeEventListener(_ partype: dynamic, _ parlistener: dynamic, _ paroptions: dynamic, _ paruseCapture: dynamic) -> dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

Function removeEventListener(partype As dynamic, parlistener As dynamic, paroptions As dynamic, paruseCapture As dynamic) As dynamic

Parameters:

  • partype:
  • parlistener:
  • paroptions:
  • paruseCapture:

send

The WebSocket.send() method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically.

 

method send(data: dynamic)

 

void send(dynamic data)

 

func send(_ data: dynamic)

 

void send(dynamic data)

 

Sub send(data As dynamic)

Parameters:

  • data: