Show / Hide Table of Contents

Class RelayClient

Inheritance
System.Object
RelayClient
Namespace: Eco.Shared.Networking
Assembly: Eco.Shared.dll
Syntax
public class RelayClient : Object

Constructors

RelayClient(IUdpPeer)

Declaration
public RelayClient(IUdpPeer peer)
Parameters
Type Name Description
IUdpPeer peer

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

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾