aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llheartbeat.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llcommon/llheartbeat.h
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/llheartbeat.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/linden/indra/llcommon/llheartbeat.h b/linden/indra/llcommon/llheartbeat.h
new file mode 100644
index 0000000..8a2fa0a
--- /dev/null
+++ b/linden/indra/llcommon/llheartbeat.h
@@ -0,0 +1,73 @@
1/**
2 * @file llheartbeat.h
3 * @brief Class encapsulating logic for telling a watchdog that we live.
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#ifndef LL_LLHEARTBEAT_H
33#define LL_LLHEARTBEAT_H
34
35#include "linden_common.h"
36
37#include "lltimer.h"
38
39// Note: Win32 does not support the heartbeat/smackdown system;
40// heartbeat-delivery turns into a no-op there.
41
42class LLHeartbeat
43{
44public:
45 // secs_between_heartbeat: after a heartbeat is successfully delivered,
46 // we suppress sending more for this length of time.
47 // aggressive_heartbeat_panic_secs: if we've been failing to
48 // successfully deliver heartbeats for this length of time then
49 // we block for a while until we're really sure we got one delivered.
50 // aggressive_heartbeat_max_blocking_secs: this is the length of
51 // time we block for when we're aggressively ensuring that a 'panic'
52 // heartbeat was delivered.
53 LLHeartbeat(F32 secs_between_heartbeat = 5.0f,
54 F32 aggressive_heartbeat_panic_secs = 10.0f,
55 F32 aggressive_heartbeat_max_blocking_secs = 4.0f);
56 ~LLHeartbeat();
57
58 bool send(F32 timeout_sec = 0.0f);
59 void setSuppressed(bool is_suppressed);
60
61private:
62 int rawSend();
63 int rawSendWithTimeout(F32 timeout_sec);
64 F32 mSecsBetweenHeartbeat;
65 F32 mAggressiveHeartbeatPanicSecs;
66 F32 mAggressiveHeartbeatMaxBlockingSecs;
67 bool mSuppressed;
68 LLTimer mBeatTimer;
69 LLTimer mPanicTimer;
70 LLTimer mTimeoutTimer;
71};
72
73#endif // LL_HEARTBEAT_H