IPWorks IoT 2020 Node.js Edition

Questions / Feedback?

IncomingHeartbeat Property

Specifies the server-to-class heartbeat timing.

Syntax

 stomp.getIncomingHeartbeat([callback])
 stomp.setIncomingHeartbeat( incomingHeartbeat, [callback])

Default Value

0

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getIncomingHeartbeat([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setIncomingHeartbeat([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This property specifies the incoming heartbeat interval, which is the number of seconds without any server-to-class communication that the server will allow to elapse before sending the class a heartbeat (keepalive). If set to 0 (default), incoming heartbeats are disabled.

For information about outgoing (class-to-server) heartbeats; see the OutgoingHeartbeat property.

Before Connecting

Before connecting, this property is used to specify the desired incoming heartbeat interval (in seconds). By default, this property is set to 0 (no heartbeat).

During the connection process, the incoming heartbeat interval requested by the class is compared to the minimum interval supported by the server, and the larger of the two values is selected. If one or both sides supply 0 as their value, then no server-to-class heartbeats will be sent.

After Connecting

After connecting, this property cannot be set. Instead, it reflects the incoming heartbeat interval agreed upon by the class and the server during the connection process.

As the incoming heartbeat interval negotiation notes above imply, it is possible that the agreed-upon incoming heartbeat interval may either be larger than what the class requested, or may be 0 (i.e., incoming heartbeats are disabled).

This property is not available at design time.

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Node.js Edition - Version 20.0 [Build 8265]