Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

NetworkClient.Configure(Tuner,int)

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

Sumbission failed

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

Close

Cancel

Switch to Manual

Parameters

tuner Use this tuner with the client instance.
maxConnections Maximum allowed simultaneous connections for given tuner.

Returns

void True if the tuner was configured successfully.

Description

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); } };