v1.0.0
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 AllocationUtilsMethods
ToRelayServerData(Allocation, String)
Convert an allocation to Transport's RelayServerData model
Declaration
public static RelayServerData ToRelayServerData(this Allocation allocation, string connectionType)Parameters
| Type | Name | Description |
|---|---|---|
| Allocation | allocation | Allocation from which to create the server data. |
| System.String | connectionType | Type of connection to use ("udp", "dtls", "ws", or "wss"). |
Returns
| Type | Description |
|---|---|
| RelayServerData | Relay server data model for Transport |
Exceptions
| Type | Condition |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| JoinAllocation | allocation | Allocation from which to create the server data. |
| System.String | connectionType | Type of connection to use ("udp", "dtls", "ws", or "wss"). |
Returns
| Type | Description |
|---|---|
| RelayServerData | Relay server data model for Transport |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown if allocation is null, if the connection type is invalid or if no endpoint match the connection type |