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 |
---|---|---|
Network |
endpoint | Endpoint of the Relay server. |
ushort | nonce | Nonce used in connection handshake (preferably random). |
Relay |
allocationId | ID of the Relay allocation. |
Relay |
connectionData | Connection data of the allocation. |
Relay |
hostConnectionData | Connection data of the host (use default for hosts). |
Relay |
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 |
---|---|---|
Network |
endpoint | |
ushort | nonce | |
Relay |
allocationId | |
Relay |
connectionData | |
Relay |
hostConnectionData | |
Relay |
key | |
bool | isSecure |