summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcircuit.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/llcircuit.h')
-rw-r--r--indra/llmessage/llcircuit.h58
1 files changed, 32 insertions, 26 deletions
diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h
index 8824e6825a..874c0c0bee 100644
--- a/indra/llmessage/llcircuit.h
+++ b/indra/llmessage/llcircuit.h
@@ -3,30 +3,25 @@
* @brief Provides a method for tracking network circuit information
* for the UDP message system
*
- * $LicenseInfo:firstyear=2001&license=viewergpl$
- *
- * Copyright (c) 2001-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -45,14 +40,11 @@
#include "llpacketack.h"
#include "lluuid.h"
#include "llthrottle.h"
+#include "llstat.h"
//
// Constants
//
-const F32 PING_INTERVAL_MAX = 100.f;
-const F32 PING_INTERVAL_ALARM = 50.f;
-
-
const F32 LL_AVERAGED_PING_ALPHA = 0.2f; // relaxation constant on ping running average
const F32 LL_AVERAGED_PING_MAX = 2000; // msec
const F32 LL_AVERAGED_PING_MIN = 100; // msec // IW: increased to avoid retransmits when a process is slow
@@ -84,7 +76,8 @@ class LLSD;
class LLCircuitData
{
public:
- LLCircuitData(const LLHost &host, TPACKETID in_id);
+ LLCircuitData(const LLHost &host, TPACKETID in_id,
+ const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
~LLCircuitData();
S32 resendUnackedPackets(const F64 now);
@@ -133,6 +126,10 @@ public:
S32 getUnackedPacketCount() const { return mUnackedPacketCount; }
S32 getUnackedPacketBytes() const { return mUnackedPacketBytes; }
F64 getNextPingSendTime() const { return mNextPingSendTime; }
+ F32 getOutOfOrderRate(LLStatAccum::TimeScale scale = LLStatAccum::SCALE_MINUTE)
+ { return mOutOfOrderRate.meanValue(scale); }
+ U32 getLastPacketGap() const { return mLastPacketGap; }
+ LLHost getHost() const { return mHost; }
LLThrottleGroup &getThrottleGroup() { return mThrottles; }
@@ -276,6 +273,11 @@ protected:
LLTimer mExistenceTimer; // initialized when circuit created, used to track bandwidth numbers
S32 mCurrentResendCount; // Number of resent packets since last spam
+ LLStatRate mOutOfOrderRate; // Rate of out of order packets coming in.
+ U32 mLastPacketGap; // Gap in sequence number of last packet.
+
+ const F32 mHeartbeatInterval;
+ const F32 mHeartbeatTimeout;
};
@@ -285,7 +287,7 @@ class LLCircuit
{
public:
// CREATORS
- LLCircuit();
+ LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout);
~LLCircuit();
// ACCESSORS
@@ -338,5 +340,9 @@ protected:
// optimize the many, many times we call findCircuit. This may be
// set in otherwise const methods, so it is declared mutable.
mutable LLCircuitData* mLastCircuit;
+
+private:
+ const F32 mHeartbeatInterval;
+ const F32 mHeartbeatTimeout;
};
#endif