From 482c721a939099be74dc6d96168402e63379d12b Mon Sep 17 00:00:00 2001 From: lidgren Date: Thu, 19 Aug 2010 07:10:25 +0000 Subject: [PATCH] Throttling config fixed --- Lidgren.Network/NetPeerConfiguration.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lidgren.Network/NetPeerConfiguration.cs b/Lidgren.Network/NetPeerConfiguration.cs index 1086663..bd0358c 100644 --- a/Lidgren.Network/NetPeerConfiguration.cs +++ b/Lidgren.Network/NetPeerConfiguration.cs @@ -343,30 +343,30 @@ namespace Lidgren.Network } /// - /// Gets or sets the number of allowed bytes to be sent per second per connection; 0 means unlimited + /// Gets or sets the number of allowed bytes to be sent per second per connection; 0 means unlimited (throttling disabled) /// public int ThrottleBytesPerSecond { get { return m_throttleBytesPerSecond; } set { - m_throttleBytesPerSecond = value; - if (m_throttleBytesPerSecond < m_maximumTransmissionUnit) + if (m_throttleBytesPerSecond != 0 && m_throttleBytesPerSecond < m_maximumTransmissionUnit) throw new NetException("ThrottleBytesPerSecond can not be lower than MaximumTransmissionUnit"); + m_throttleBytesPerSecond = value; } } /// - /// Gets or sets the peak number of bytes sent before throttling kicks in + /// Gets or sets the peak number of bytes sent before throttling kicks in, if enabled /// public int ThrottlePeakBytes { get { return m_throttlePeakBytes; } set { - m_throttlePeakBytes = value; if (m_throttlePeakBytes < m_maximumTransmissionUnit) throw new NetException("ThrottlePeakBytes can not be lower than MaximumTransmissionUnit"); + m_throttlePeakBytes = value; } }