docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor RelayServerData

    RelayServerData(string, ushort, byte[], byte[], byte[], byte[], bool, 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, bool isWebSocket)
    Parameters
    Type Name Description
    string host

    IP address or hostname 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.

    bool isWebSocket

    Whether the Relay connection is using WebSockets or not.

    Remarks

    If a hostname is provided as the "host" parameter, this constructor will perform a DNS resolution to map it to an IP address. If the hostname is not in the OS cache, this operation can possibly block for a long time (between 20 and 120 milliseconds). If this is a concern, perform the DNS resolution asynchronously and pass in the resulting IP address directly (for example with System.Net.Dns.GetHostEntryAsync").

    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 or hostname 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.

    Remarks

    If a hostname is provided as the "host" parameter, this constructor will perform a DNS resolution to map it to an IP address. If the hostname is not in the OS cache, this operation can possibly block for a long time (between 20 and 120 milliseconds). If this is a concern, perform the DNS resolution asynchronously and pass in the resulting IP address directly (for example with System.Net.Dns.GetHostEntryAsync").

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

    Create a new Relay server data structure (low-level constructor).

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

    Endpoint of the Relay server.

    ushort nonce

    Nonce used in connection handshake (preferably random).

    RelayAllocationId allocationId

    ID of the Relay allocation.

    RelayConnectionData connectionData

    Connection data of the allocation.

    RelayConnectionData hostConnectionData

    Connection data of the host (use default for hosts).

    RelayHMACKey key

    HMAC signature of the allocation.

    bool isSecure

    Whether the Relay connection is to be secured or not.

    bool isWebSocket

    Whether the Relay connection is using WebSockets or not.

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

    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
    ushort nonce
    RelayAllocationId allocationId
    RelayConnectionData connectionData
    RelayConnectionData hostConnectionData
    RelayHMACKey key
    bool isSecure
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023