Show / Hide Table of Contents

Class SimpleUnconnectedUdpPeer

Simplest implementation of Unconnected UDP peer (used by master server) which doesn't use any third-party library, but just async sockets from .NET Core.

Inheritance
System.Object
SimpleUnconnectedUdpPeer
Implements
IUnconnectedUdpPeer
Namespace: Eco.Shared.Networking.Udp
Assembly: Eco.Shared.dll
Syntax
public class SimpleUnconnectedUdpPeer : Object, IUnconnectedUdpPeer

Constructors

SimpleUnconnectedUdpPeer(Int32)

Declaration
public SimpleUnconnectedUdpPeer(int port = 0)
Parameters
Type Name Description
System.Int32 port

Properties

IsRunning

Declaration
public bool IsRunning { get; }
Property Value
Type Description
System.Boolean

LocalEndPoint

Declaration
public IPEndPoint LocalEndPoint { get; }
Property Value
Type Description
System.Net.IPEndPoint

MaximumUnconnectedMessageLength

Declaration
public int MaximumUnconnectedMessageLength { get; }
Property Value
Type Description
System.Int32

Port

Declaration
public int Port { get; }
Property Value
Type Description
System.Int32

ReceiveBufferSize

Declaration
public int ReceiveBufferSize { get; set; }
Property Value
Type Description
System.Int32

SendBufferSize

Declaration
public int SendBufferSize { get; set; }
Property Value
Type Description
System.Int32

Methods

add_UnconnectedDataMessageReceived(UdpDataMessageHandler)

Declaration
public void add_UnconnectedDataMessageReceived(UdpDataMessageHandler value)
Parameters
Type Name Description
UdpDataMessageHandler value

remove_UnconnectedDataMessageReceived(UdpDataMessageHandler)

Declaration
public void remove_UnconnectedDataMessageReceived(UdpDataMessageHandler value)
Parameters
Type Name Description
UdpDataMessageHandler value

SendRaw(IPEndPoint, Byte[], Int32, Int32)

Declaration
public void SendRaw(IPEndPoint remoteEndPoint, byte[] messageData, int offset, int length)
Parameters
Type Name Description
System.Net.IPEndPoint remoteEndPoint
System.Byte[] messageData
System.Int32 offset
System.Int32 length

SendUnconnectedMessage(IPEndPoint, Byte[], Int32, Int32)

Declaration
public void SendUnconnectedMessage(IPEndPoint remoteEndPoint, byte[] messageData, int offset, int length)
Parameters
Type Name Description
System.Net.IPEndPoint remoteEndPoint
System.Byte[] messageData
System.Int32 offset
System.Int32 length

Service(Int32)

Declaration
public void Service(int timeoutMs)
Parameters
Type Name Description
System.Int32 timeoutMs

ServiceOne(Int32)

Declaration
public bool ServiceOne(int timeoutMs)
Parameters
Type Name Description
System.Int32 timeoutMs
Returns
Type Description
System.Boolean

Shutdown()

Declaration
public void Shutdown()

Start()

Declaration
public void Start()

SyncTimer(Double)

Declaration
public void SyncTimer(double currentTimeInSeconds)
Parameters
Type Name Description
System.Double currentTimeInSeconds

Events

DebugMessageReceived

Declaration
public event Action<string> DebugMessageReceived
Event Type
Type Description
System.Action<System.String>

ErrorMessageReceived

Declaration
public event Action<string> ErrorMessageReceived
Event Type
Type Description
System.Action<System.String>

UnconnectedDataMessageReceived

Declaration
public event UdpDataMessageHandler UnconnectedDataMessageReceived
Event Type
Type Description
UdpDataMessageHandler

WarningMessageReceived

Declaration
public event Action<string> WarningMessageReceived
Event Type
Type Description
System.Action<System.String>

Implements

IUnconnectedUdpPeer

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
☀
☾