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
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
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
remove_UnconnectedDataMessageReceived(UdpDataMessageHandler)
Declaration
public void remove_UnconnectedDataMessageReceived(UdpDataMessageHandler value)
Parameters
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
Start()
Declaration
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
WarningMessageReceived
Declaration
public event Action<string> WarningMessageReceived
Event Type
Type |
Description |
System.Action<System.String> |
|
Implements
Extension Methods