WebConnect

The LocalStorage class encapsulates the access to data objects.

Import
the javascript logo
import { WebConnect } from "@schukai/monster/source/net/webconnect.mjs";
Source
the git logo
Package
the npm logo
Since
3.1.0

Exported

WebConnect

Derived from

BaseWithOptions

Options

The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the BaseWithOptions.

Option
Type
Default
Description
url
string
undefined
source that you wish to fetch.
object
connection
connection.timeout
object
5000
the connection.
connection.reconnect.timeout
number
1000
The timeout in milliseconds for the reconnect.
connection.reconnect.attempts
number
1
The maximum number of reconnects.
connection.reconnect.enabled
boolean
false
If the reconnect is enabled.

Properties

The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the BaseWithOptions.

Methods

The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the BaseWithOptions.

Constructor

constructor([options])
Parameters
  • [options] {object}: options contains definitions for the webconnect.

Behavioral methods

close([code=1000],[reason=""])
Parameters
  • [code=1000] {number}: The close code.
  • [reason=""] {string}: The close reason.
Returns
  • {Promise}
This method closes the connection.

State query methods

isConnected()
Returns
  • {boolean}

Static methods

[instanceSymbol]()
Returns
  • {symbol}
This method is called by the instanceof operator.

Other methods

attachObserver(observer)
Parameters
  • observer {observer}: observer
Returns
  • {ProxyObserver}
Attach a new observer
connect()
Returns
  • {Promise}
containsObserver(observer)
Parameters
  • observer {observer}: observer
Returns
  • {boolean}
dataReceived()
Returns
  • {boolean}
Are there any messages in the receive queue?
detachObserver(observer)
Parameters
  • observer {observer}: observer
Returns
  • {ProxyObserver}
Detach a observer
peek()
Returns
  • {Object}
Get Message from the receive queue, but do not remove it.
poll()
Returns
  • {Message}
Polls the receive queue for new messages.
send(message)
Parameters
  • message {message|object}: message
Returns
  • {Promise}

Events

This component does not fire any public events. It may fire events that are inherited from its parent classes.

The current width of the area is too small to display the content correctly.