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 client instance. |
maxConnections | Maximum allowed simultaneous connections for given tuner. |
void True if the tuner was configured successfully.
Configure the client instance with the given tuner and connection count.
If you don't configure the client before connecting the default tuner (called "defaultClient") and connection count of one, will be used.
If you use the same tuner for other client instances the connection count must reflect that.
#pragma strict public class Example extends MonoBehaviour { function DoConnect() { var tuner: Tuner = new Tuner("mytuner"); tuner.AddChannel(UNETQosType.ReliableSequenced); tuner.AddChannel(UNETQosType.UnreliableSequenced); tuner.maxPacketSize = 500; NetworkClient.Instance.Configure(tuner, 1); NetworkClient.Instance.Connect("127.0.0.1", 7070); } }
using UnityEngine; using UnityEngine.Networking;
public class Example : MonoBehaviour { void DoConnect() { Tuner tuner = new Tuner("mytuner"); tuner.AddChannel(UNETQosType.ReliableSequenced); tuner.AddChannel(UNETQosType.UnreliableSequenced); tuner.maxPacketSize = 500; NetworkClient.Instance.Configure(tuner, 1); NetworkClient.Instance.Connect("127.0.0.1", 7070); } };