Defines the maximum size in bytes of a reliable message which is considered small enough to include in a combined message. Default value = 100.
Since each message sent to a server contains IP information and a UDP header, duplicating this information for every message sent can be inefficient in the case where there are many small messages being sent frequently. Many small reliable messages can be combined into one longer reliable message, saving space in the waiting buffer. Unity Multiplayer will automatically combine up to MaxCombinedReliableMessageCount small messages into one message. To qualify as a small message, the data payload of the message should not be greater than MaxCombinedReliableMessageSize.
using UnityEngine; using UnityEngine.Networking;
public class ExampleScript : NetworkBehaviour { void Start() { ConnectionConfig myConfig = new ConnectionConfig(); myConfig.AddChannel(QosType.Unreliable); myConfig.AddChannel(QosType.UnreliableFragmented); myConfig.MaxCombinedReliableMessageCount = 20; //up to 20 messages myConfig.MaxCombinedReliableMessageSize = 500; //up to 500 bytes each } }
Did you find this page useful? Please give it a rating: