v1.0.0
Latest
2022.3+

Class AllocationUtils

Utility methods for relay allocations

Inheritance
System.Object
AllocationUtils
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Relay.Models
Syntax
public static class AllocationUtils

Methods

ToRelayServerData(Allocation, String)

Convert an allocation to Transport's RelayServerData model

Declaration
public static RelayServerData ToRelayServerData(this Allocation allocation, string connectionType)
Parameters
TypeNameDescription
Allocationallocation

Allocation from which to create the server data.

System.StringconnectionType

Type of connection to use ("udp", "dtls", "ws", or "wss").

Returns
TypeDescription
RelayServerData

Relay server data model for Transport

Exceptions
TypeCondition
System.ArgumentException

Thrown if allocation is null, if the connection type is invalid or if no endpoint match the connection type

ToRelayServerData(JoinAllocation, String)

Convert an allocation to Transport's RelayServerData model

Declaration
public static RelayServerData ToRelayServerData(this JoinAllocation allocation, string connectionType)
Parameters
TypeNameDescription
JoinAllocationallocation

Allocation from which to create the server data.

System.StringconnectionType

Type of connection to use ("udp", "dtls", "ws", or "wss").

Returns
TypeDescription
RelayServerData

Relay server data model for Transport

Exceptions
TypeCondition
System.ArgumentException

Thrown if allocation is null, if the connection type is invalid or if no endpoint match the connection type