docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct RelayServerData

    Used by the Relay Protocol to describe how to connect to the Relay Service.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Networking.Transport.Relay
    Assembly: Unity.Networking.Transport.dll
    Syntax
    public struct RelayServerData

    Constructors

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

    Create a new Relay server data structure.

    Declaration
    public RelayServerData(string host, ushort port, byte[] allocationId, byte[] connectionData, byte[] hostConnectionData, byte[] key, bool isSecure)
    Parameters
    Type Name Description
    string host

    IP address of the Relay server.

    ushort port

    Port of the Relay server.

    byte[] allocationId

    ID of the Relay allocation.

    byte[] connectionData

    Connection data of the allocation.

    byte[] hostConnectionData

    Connection data of the host (same as previous for hosts).

    byte[] key

    HMAC signature of the allocation.

    bool isSecure

    Whether the Relay connection is to be secured or not.

    RelayServerData(ref NetworkEndPoint, ushort, RelayAllocationId, string, string, string, bool)

    Initializes a new instance of the RelayServerData class

    Declaration
    [Obsolete("Will be removed in Unity Transport 2.0. Use the new constructor introduced in 1.3 instead.", false)]
    public RelayServerData(ref NetworkEndPoint endpoint, ushort nonce, RelayAllocationId allocationId, string connectionData, string hostConnectionData, string key, bool isSecure)
    Parameters
    Type Name Description
    NetworkEndPoint endpoint

    The endpoint

    ushort nonce

    The nonce

    RelayAllocationId allocationId

    The allocation id

    string connectionData

    The connection data

    string hostConnectionData

    The host connection data

    string key

    The key

    bool isSecure

    The is secure

    RelayServerData(ref NetworkEndPoint, ushort, ref RelayAllocationId, ref RelayConnectionData, ref RelayConnectionData, ref RelayHMACKey, bool)

    Initializes a new instance of the RelayServerData class

    Declaration
    public RelayServerData(ref NetworkEndPoint endpoint, ushort nonce, ref RelayAllocationId allocationId, ref RelayConnectionData connectionData, ref RelayConnectionData hostConnectionData, ref RelayHMACKey key, bool isSecure)
    Parameters
    Type Name Description
    NetworkEndPoint endpoint

    The endpoint

    ushort nonce

    The nonce

    RelayAllocationId allocationId

    The allocation id

    RelayConnectionData connectionData

    The connection data

    RelayConnectionData hostConnectionData

    The host connection data

    RelayHMACKey key

    The key

    bool isSecure

    The is secure

    Fields

    AllocationId

    The unique identifier of the client on the Relay Server.

    Declaration
    public RelayAllocationId AllocationId
    Field Value
    Type Description
    RelayAllocationId

    ConnectionData

    The data that describes the client presence on the Relay Server.

    Declaration
    public RelayConnectionData ConnectionData
    Field Value
    Type Description
    RelayConnectionData

    Endpoint

    The endpoint of the Relay Server.

    Declaration
    public NetworkEndPoint Endpoint
    Field Value
    Type Description
    NetworkEndPoint

    HMAC

    The computed HMAC.

    Declaration
    public byte* HMAC
    Field Value
    Type Description
    byte*

    HMACKey

    The HMAC key for the connection.

    Declaration
    public RelayHMACKey HMACKey
    Field Value
    Type Description
    RelayHMACKey

    HostConnectionData

    The connection data of the host client on the Relay Server.

    Declaration
    public RelayConnectionData HostConnectionData
    Field Value
    Type Description
    RelayConnectionData

    IsSecure

    A byte that identifies the connection as secured.

    Declaration
    public readonly byte IsSecure
    Field Value
    Type Description
    byte

    Nonce

    The Nonce value used to stablish the connection with the Relay Server.

    Declaration
    public ushort Nonce
    Field Value
    Type Description
    ushort

    Methods

    ComputeNewNonce()

    Computes the new nonce, this must be called one time!

    Declaration
    [Obsolete("Will be removed in Unity Transport 2.0. There shouldn't be any need to call this method.")]
    public void ComputeNewNonce()
    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)