IPWorks IoT 2020 Python Edition

Questions / Feedback?

heartbeat Property

The heartbeat timeout value.

Syntax

def get_heartbeat() -> int: ...
def set_heartbeat(value: int) -> None: ...

heartbeat = property(get_heartbeat, set_heartbeat)

Default Value

0

Remarks

This property specifies the heartbeat timeout value, in seconds. Heartbeats are disabled if set to 0 (default).

Before connecting, this property can be set to indicate the desired heartbeat timeout value. During the connection process, the class and the server will compare their desired heartbeat values and choose the lower one.

Once connected, this property will reflect the agreed-upon heartbeat value. While the connection is idle, heartbeats are sent by both the class and the server approximately once every (heartbeat / 2) seconds. If either side has not received a heartbeat (or other transmission) for ~heartbeat seconds, it will consider the other side unreachable and close the connection.

This setting cannot be changed while connected.

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