activeHeartbeatTimers

activeHeartbeatTimers — determines if both heartbeat timers are active.

Syntax

For C++ and C#:

bool activeHeartbeatTimers(void);

For Java:

boolean activeHeartbeatTimers(void);

Returns

TRUE if both heartbeat timers are active, FALSE otherwise.

Description

This method is used to determine if both heartbeat timers were successfully started. The heartbeat timers are normally started when a connection has been established (see startHeartbeatTimers). You may wish to check that the heartbeat mechanism is active before registering a domain or points.

See Also

startHeartbeatTimers, cancelHeartbeatTimers, setHeartbeatTimes

Example

void DataGenerator::onConnectionSuccess (LPCTSTR host, int port)
{
    _super::onConnectionSuccess (host, port);	// starts the heartbeat timers

    // proceed to start heartbeat and specify domain
    int domain_flags = DHC_FLAG_REG_FUTURE|
                       DHC_FLAG_REG_QUALIFY|
                       DHC_FLAG_REG_ONCEONLY;

    if (activeHeartbeatTimers()) // started the heartbeat timers
    {
        if (registerDomain (m_DomainName, (DHC_tRegFlags)domain_flags) == ST_OK)
        {
            RegisterPoints();
        }
    }
}