Select your preferred scripting language. All code snippets will be displayed in this language.
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.
Closetuner | Use this tuner with the server. |
maxConnections | Maximum allowed simultaneous connections for given tuner. |
Configure the server with the given tuner and connection count.
If you don't configure the server before starting it (with Listen) the default tuner (called "defaultServer") and connection count of 8, will be used.
no example available in JavaScript
using UnityEngine; using UnityEngine.Networking;
public class Example : MonoBehaviour {
void StartServer() { Tuner tuner = new Tuner("mytuner"); tuner.AddChannel(UNETQosType.ReliableSequenced); tuner.AddChannel(UNETQosType.UnreliableSequenced); tuner.maxPacketSize = 500; NetworkServer.Instance.Configure(tuner, 10); NetworkServer.Instance.Listen(7070); } }