2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-06-13 14:38:43 +00:00
This commit is contained in:
2026-05-26 16:18:57 +03:00
parent e4a54ffbe8
commit a91fc7d262
29 changed files with 206 additions and 148 deletions
+6 -6
View File
@@ -55,14 +55,14 @@ public class UdpServer : IResource
set;
}
[Attribute]
//[Attribute]
string IP
{
get;
set;
}
[Attribute]
//[Attribute]
ushort Port
{
get;
@@ -177,9 +177,9 @@ public class UdpServer : IResource
OnDestroy?.Invoke(this);
}
async AsyncReply<bool> IResource.Trigger(ResourceOperation trigger)
public async AsyncReply<bool> Handle(ResourceOperation operation, IResourceContext context = null)
{
if (trigger == ResourceOperation.Initialize)
if (operation == ResourceOperation.Initialize)
{
var address = IP == null ? IPAddress.Any : IPAddress.Parse(IP);
@@ -188,12 +188,12 @@ public class UdpServer : IResource
receiver = new Thread(Receiving);
receiver.Start();
}
else if (trigger == ResourceOperation.Terminate)
else if (operation == ResourceOperation.Terminate)
{
if (receiver != null)
receiver.Abort();
}
else if (trigger == ResourceOperation.SystemInitialized)
else if (operation == ResourceOperation.SystemReady)
{
filters = await Instance.Children<UdpFilter>();
}