Monster.Net. WebConnect

In this namespace you will find classes and methods for handling data.

Author
  • schukai GmbH

Members

defaults

Properties
NameTypeDescription
urlstring

Defines the resource that you wish to fetch.

connectionObject
Properties
NameTypeDefaultDescription
timeoutObject5000

Defines the timeout for the connection.

reconnect.timeoutNumber

The timeout in milliseconds for the reconnect.

reconnect.attemptsNumber

The maximum number of reconnects.

reconnect.enabledBool

If the reconnect is enabled.

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Methods

attachObserver(observer) → {ProxyObserver}

Attach a new observer

.

Attach a new observer

Parameters:
NameTypeDescription
observerObserver
Returns:
Type: 
ProxyObserver

close(codeopt, reasonopt) → {Promise}

This method closes the connection.

This method closes the connection.

Parameters:
NameTypeAttributesDefaultDescription
codeNumber<optional>
1000

The close code.

reasonString<optional>
""

The close reason.

Returns:
Type: 
Promise

connect() → {Promise}

Returns:
Type: 
Promise

containsObserver(observer) → {boolean}

Parameters:
NameTypeDescription
observerObserver
Returns:
Type: 
boolean

dataReceived() → {boolean}

Are there any messages in the receive queue?

.

Are there any messages in the receive queue?

Returns:
Type: 
boolean

detachObserver(observer) → {ProxyObserver}

Detach a observer

.

Detach a observer

Parameters:
NameTypeDescription
observerObserver
Returns:
Type: 
ProxyObserver

isConnected() → {boolean}

Returns:
Type: 
boolean

peek() → {Object}

Get Message from the receive queue, but do not remove it.

Get Message from the receive queue, but do not remove it.

Returns:
Type: 
Object

poll() → {Message}

Polls the receive queue for new messages.

Polls the receive queue for new messages.

Returns:
Type: 
Message

send(message) → {Promise}

Parameters:
NameTypeDescription
messageMessage | Object
Returns:
Type: 
Promise