Version: 2017.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ConnectionConfig.NetworkDropThreshold

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public var NetworkDropThreshold: byte;
public byte NetworkDropThreshold;

Description

Defines the percentage (from 0 to 100) of packets that need to be dropped due to network conditions before the SendUpdate timeout is automatically increased (and send rate is automatically decreased). Default value = 5.

To avoid receiver overflow, Unity Multiplayer supports flow control. Each ping packet sent between connected peers contains two values:
(1) Packets lost due to network conditions.
(2) Packets lost because the receiver does not have free space in its incoming buffers.
Like OverflowDropThreshold, both values are reported in percent. Use NetworkDropThreshold and OverflowDropThreshold to set thresholds for these values. If a value reported in the ping packet exceeds the corresponding threshold, Unity Multiplayer increases the sending timeout for packets up to a maximum value of DisconnectTimeout.

Note: wireless networks usually exhibit 5% or greater packet loss. For wireless networks it is advisable to use a NetworkDropThreshold of 40-50%.

no example available in JavaScript
using UnityEngine;
using UnityEngine.Networking;

public class ExampleScript : NetworkBehaviour { void Start() { ConnectionConfig myConfig = new ConnectionConfig(); myConfig.AddChannel(QosType.Unreliable); myConfig.AddChannel(QosType.UnreliableFragmented); myConfig.NetworkDropThreshold = 50; //50% myConfig.OverflowDropThreshold = 10; //10% } }