Class RelayClient
Inheritance
System.Object
RelayClient
Assembly: Eco.Shared.dll
Syntax
public class RelayClient : Object
Constructors
RelayClient(IUdpPeer)
Declaration
public RelayClient(IUdpPeer peer)
Parameters
Fields
BetterRelayServerDiscovered
Declaration
public Action<IPEndPoint> BetterRelayServerDiscovered
Field Value
Type |
Description |
System.Action<System.Net.IPEndPoint> |
|
DefaultRelayServerPort
Declaration
public const int DefaultRelayServerPort = 3300
Field Value
Type |
Description |
System.Int32 |
Default Relay Server port.
|
RelayPingReceived
Declaration
public Action<IPEndPoint> RelayPingReceived
Field Value
Type |
Description |
System.Action<System.Net.IPEndPoint> |
|
RelayServerProtocolVersion
Declaration
public const byte RelayServerProtocolVersion = 0
Field Value
Type |
Description |
System.Byte |
Current message serialization version, bump when message format changes.
|
Properties
IsServer
Declaration
public bool IsServer { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
ConnectWithRelay(IPEndPoint, Guid)
Declaration
public void ConnectWithRelay(IPEndPoint relayEndpoint, Guid serverID)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
relayEndpoint |
|
System.Guid |
serverID |
|
ProcessPingReply(IPEndPoint, ref ByteSpanReader)
Declaration
public void ProcessPingReply(IPEndPoint senderEndpoint, ref ByteSpanReader reader)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
senderEndpoint |
|
ByteSpanReader |
reader |
|
RefreshRelayServerEndpoint()
Declaration
public void RefreshRelayServerEndpoint()
RegisterServer(IPEndPoint, Guid, Guid)
Declaration
public void RegisterServer(IPEndPoint relayEndpoint, Guid serverId, Guid passport)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
relayEndpoint |
|
System.Guid |
serverId |
|
System.Guid |
passport |
|
SendPing(String)
Declaration
public void SendPing(string address)
Parameters
Type |
Name |
Description |
System.String |
address |
|
StartRefreshing()
Declaration
public void StartRefreshing()
StopRefreshing()
Declaration
public void StopRefreshing()
TryProcessRelayIntroduce(IPEndPoint, ref ByteSpanReader, in Guid, out IPEndPoint)
Processes relay introduce message:
[remote port:2 bytes][server id:guid].
Declaration
public bool TryProcessRelayIntroduce(IPEndPoint senderEndpoint, ref ByteSpanReader reader, in Guid serverId, out IPEndPoint connectionEndPoint)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
senderEndpoint |
remote endpoint from which message received.
|
ByteSpanReader |
reader |
reference to message data reader.
|
System.Guid |
serverId |
expected server id.
|
System.Net.IPEndPoint |
connectionEndPoint |
output parameter for connection end point.
|
Returns
Type |
Description |
System.Boolean |
|
Extension Methods