docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UnityTransport

    The Netcode for GameObjects NetworkTransport for UnityTransport. Note: This is highly recommended to use over UNet.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    NetworkTransport
    UnityTransport
    Implements
    INetworkStreamDriverConstructor
    Inherited Members
    NetworkTransport.IsSupported
    NetworkTransport.OnTransportEvent
    NetworkTransport.InvokeOnTransportEvent(NetworkEvent, ulong, ArraySegment<byte>, float)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Netcode.Transports.UTP
    Assembly: solution.dll
    Syntax
    [AddComponentMenu("Netcode/Unity Transport")]
    public class UnityTransport : NetworkTransport, INetworkStreamDriverConstructor

    Fields

    Name Description
    ConnectionData

    The connection (address) data for this UnityTransport instance. This is where you can change IP Address, Port, or server's listen address. UnityTransport.ConnectionAddressData

    DebugSimulator

    Can be used to simulate poor network conditions such as:

    • packet delay/latency
    • packet jitter (variances in latency, see: https://en.wikipedia.org/wiki/Jitter)
    • packet drop rate (packet loss)
    InitialMaxPacketQueueSize

    The default maximum (receive) packet queue size

    InitialMaxPayloadSize

    The default maximum payload size

    InitialMaxSendQueueSize

    The default maximum send queue size

    s_DriverConstructor

    The global INetworkStreamDriverConstructor implementation

    Properties

    Name Description
    ConnectTimeoutMS

    Timeout in milliseconds indicating how long we will wait until we send a new connection attempt.

    DisconnectTimeoutMS

    Inactivity timeout after which a connection will be disconnected.

    DriverConstructor

    Returns either the global INetworkStreamDriverConstructor implementation or the current UnityTransport instance

    HeartbeatTimeoutMS

    Timeout in milliseconds after which a heartbeat is sent if there is no activity.

    MaxConnectAttempts

    The maximum amount of connection attempts we will try before disconnecting.

    MaxPacketQueueSize

    The maximum amount of packets that can be in the internal send/receive queues.

    MaxPayloadSize

    The maximum size of an unreliable payload that can be handled by the transport.

    MaxSendQueueSize

    The maximum size in bytes of the transport send queue.

    Protocol

    The current ProtocolType used by the transport

    ServerClientId

    The client id used to represent the server.

    Methods

    Name Description
    CreateDriver(UnityTransport, out NetworkDriver, out NetworkPipeline, out NetworkPipeline, out NetworkPipeline)

    Creates the internal NetworkDriver

    DisconnectLocalClient()

    Disconnects the local client from the remote

    DisconnectRemoteClient(ulong)

    Disconnects a remote client from the server

    GetCurrentRtt(ulong)

    Gets the current RTT for a specific client

    Initialize(NetworkManager)

    Initializes the transport

    PollEvent(out ulong, out ArraySegment<byte>, out float)

    Polls for incoming events, with an extra output parameter to report the precise time the event was received.

    Send(ulong, ArraySegment<byte>, NetworkDelivery)

    Send a payload to the specified clientId, data and networkDelivery.

    SetClientRelayData(string, ushort, byte[], byte[], byte[], byte[], bool)

    Set the relay server data for the host.

    SetClientSecrets(string, string)

    Set the client parameters for encryption.

    SetConnectionData(string, ushort, string)

    Sets IP and Port information. This will be ignored if using the Unity Relay and you should call SetRelayServerData(string, ushort, byte[], byte[], byte[], byte[], bool)

    SetConnectionData(NetworkEndPoint, NetworkEndPoint)

    Sets IP and Port information. This will be ignored if using the Unity Relay and you should call SetRelayServerData(string, ushort, byte[], byte[], byte[], byte[], bool)

    SetDebugSimulatorParameters(int, int, int)

    Set the parameters for the debug simulator.

    SetHostRelayData(string, ushort, byte[], byte[], byte[], bool)

    Set the relay server data for the host.

    SetRelayServerData(string, ushort, byte[], byte[], byte[], byte[], bool)

    Set the relay server data for the server.

    SetRelayServerData(RelayServerData)

    Set the relay server data (using the lower-level Unity Transport data structure).

    SetServerSecrets(string, string)

    Set the server parameters for encryption.

    Shutdown()

    Shuts down the transport

    StartClient()

    Connects client to the server Note: When this method returns false it could mean:

    • You are trying to start a client that is already started
    • It failed during the initial port binding when attempting to begin to connect
    StartServer()

    Starts to listening for incoming clients Note: When this method returns false it could mean:

    • You are trying to start a client that is already started
    • It failed during the initial port binding when attempting to begin to connect
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)