ENet Class Library for C#

Peer.ConfigureThrottle Method

Configures throttling. ENet measures lag over an interval, and alters its throttle parameter based on individual packet round-trip times versus the mean. This parameter controls the probability ENet will drop an unreliable packet. If a packet has a smaller round-trip time than average, the parameter is increased by the acceleration term, causing less packets to be dropped. If a packet has a larger round-trip time than average, the parameter is decreased by the deceleration term, causing more packets to be dropped.

[Visual Basic]
Public Sub ConfigureThrottle( _
   ByVal interval As Integer, _
   ByVal acceleration As Integer, _
   ByVal deceleration As Integer _
)
[C#]
public void ConfigureThrottle(
   int interval,
   int acceleration,
   int deceleration
);

Parameters

interval
The interval in milliseconds over which to measure. The default is 5000.
acceleration
Acceleration rate. The default value is 2, and the limit is 32.
deceleration
Deceleration rate. The default value is 2, and the limit is 32.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException interval is negative, acceleration is less than 0 or greater than 32, and/or deceleration is less than 0 or greater than 32.
InvalidOperationException The peer is not initialized.

See Also

Peer Class | ENet Namespace