ST_STATUS setHeartbeatTimes(
long heartbeat_ms, long timeout_ms )
;
Exception setHeartbeatTimes(
long heartbeat_ms, long timeout_ms )
;
The period in milliseconds for the heartbeat timer, or 0 if a timer will not be used.
The period in milliseconds for the timeout timer, or 0 if a timer will not be used.
ST_OK if the timer values accepted, otherwise ST_ERROR. ST_ERROR can occur for the following reasons:
The timeout timer value is not greater than heartbeat (if both values are greater than 0).
The timers were already active and either timer failed to restart.
The DataHub and API provide two heartbeat services to ensure the integrity of the connection:
A local, internal timeout timer, which when it fires, will close the connection and generate an error.
A periodic 'alive' heartbeat message from the DataHub, which triggers the virtual method onAlive.
The timers can be started with startHeartbeatTimers once the respective periods have been set. If a timer is already running when setHeartbeatTimes is called, then that timer is restarted with the new period. If the timer is already running and the specified period is 0, then the timer is stopped.
The timeout timer is automatically reset whenever there is any activity over the connection, including the heartbeat timer message.
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.