docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct UnityTransport.ConnectionAddressData

    Structure to store the address to connect to

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Netcode.Transports.UTP
    Assembly: Unity.Netcode.Runtime.dll
    Syntax
    [Serializable]
    public struct UnityTransport.ConnectionAddressData

    Fields

    Address

    IP address of the server (address to which clients will connect to).

    Declaration
    [Tooltip("IP address of the server (address to which clients will connect to).")]
    [SerializeField]
    public string Address
    Field Value
    Type Description
    string

    Port

    UDP port of the server.

    Declaration
    [Tooltip("UDP port of the server.")]
    [SerializeField]
    public ushort Port
    Field Value
    Type Description
    ushort

    ServerListenAddress

    IP address the server will listen on. If not provided, will use localhost.

    Declaration
    [Tooltip("IP address the server will listen on. If not provided, will use localhost.")]
    [SerializeField]
    public string ServerListenAddress
    Field Value
    Type Description
    string

    Properties

    IsIpv6

    Returns true if the end point address is of type Unity.Networking.Transport.NetworkFamily.Ipv6 or if it is a hostname (because in current versions of the engine, hostname resolution prioritizes IPv6 addresses).

    Declaration
    public bool IsIpv6 { get; }
    Property Value
    Type Description
    bool

    ListenEndPoint

    Endpoint (IP address and port) server will listen/bind on.

    Declaration
    public NetworkEndpoint ListenEndPoint { get; }
    Property Value
    Type Description
    NetworkEndpoint

    ServerEndPoint

    Endpoint (IP address and port) clients will connect to.

    Declaration
    [Obsolete("Use NetworkEndpoint.Parse on the Address field instead.")]
    public NetworkEndpoint ServerEndPoint { get; }
    Property Value
    Type Description
    NetworkEndpoint
    Remarks

    If a DNS hostname was set as the address, this will return an invalid endpoint. This is still handled correctly by NGO, but for this reason usage of this property is discouraged.

    In This Article
    Back to top
    Copyright © 2025 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)