mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 14:38:43 +00:00
Handle
This commit is contained in:
@@ -9,7 +9,7 @@ using System.Text;
|
||||
namespace Esiur.Net.Http;
|
||||
public class EpOverHttp : HttpFilter
|
||||
{
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
EntryPoint EntryPoint { get; set; }
|
||||
|
||||
public override AsyncReply<bool> Execute(HttpConnection sender)
|
||||
@@ -30,7 +30,7 @@ public class EpOverHttp : HttpFilter
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
|
||||
public override AsyncReply<bool> Trigger(ResourceOperation trigger)
|
||||
public override AsyncReply<bool> Handle(ResourceOperation operation, IResourceContext context = null)
|
||||
{
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
|
||||
@@ -33,9 +33,10 @@ using Esiur.Core;
|
||||
using Esiur.Protocol;
|
||||
|
||||
namespace Esiur.Net.Http;
|
||||
|
||||
public class EpOvwerWebsocket : HttpFilter
|
||||
{
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public EpServer Server
|
||||
{
|
||||
get;
|
||||
@@ -72,7 +73,7 @@ public class EpOvwerWebsocket : HttpFilter
|
||||
|
||||
}
|
||||
|
||||
public override AsyncReply<bool> Trigger(ResourceOperation trigger)
|
||||
public override AsyncReply<bool> Handle(ResourceOperation operation, IResourceContext context = null)
|
||||
{
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class HttpFilter : IResource
|
||||
}
|
||||
|
||||
public event DestroyedEvent OnDestroy;
|
||||
public abstract AsyncReply<bool> Trigger(ResourceOperation trigger);
|
||||
public abstract AsyncReply<bool> Handle(ResourceOperation operation, IResourceContext context = null);
|
||||
|
||||
/*
|
||||
public virtual void SessionModified(HTTPSession session, string key, object oldValue, object newValue)
|
||||
|
||||
@@ -139,14 +139,14 @@ public class HttpServer : NetworkServer<HttpConnection>, IResource
|
||||
set;
|
||||
}
|
||||
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public virtual string IP
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public virtual ushort Port
|
||||
{
|
||||
get;
|
||||
@@ -154,21 +154,21 @@ public class HttpServer : NetworkServer<HttpConnection>, IResource
|
||||
}
|
||||
|
||||
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public virtual uint MaxPost
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public virtual bool SSL
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Attribute]
|
||||
//[Attribute]
|
||||
public virtual string Certificate
|
||||
{
|
||||
get;
|
||||
@@ -291,10 +291,10 @@ public class HttpServer : NetworkServer<HttpConnection>, IResource
|
||||
*/
|
||||
|
||||
|
||||
public async AsyncReply<bool> Trigger(ResourceOperation trigger)
|
||||
public async AsyncReply<bool> Handle(ResourceOperation operation, IResourceContext context = null)
|
||||
{
|
||||
|
||||
if (trigger == ResourceOperation.Initialize)
|
||||
if (operation == ResourceOperation.Initialize)
|
||||
{
|
||||
//var ip = (IPAddress)Instance.Attributes["ip"];
|
||||
//var port = (int)Instance.Attributes["port"];
|
||||
@@ -318,16 +318,16 @@ public class HttpServer : NetworkServer<HttpConnection>, IResource
|
||||
|
||||
Start(listener);
|
||||
}
|
||||
else if (trigger == ResourceOperation.Terminate)
|
||||
else if (operation == ResourceOperation.Terminate)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
else if (trigger == ResourceOperation.SystemReload)
|
||||
else if (operation == ResourceOperation.SystemReloading)
|
||||
{
|
||||
await Trigger(ResourceOperation.Terminate);
|
||||
await Trigger(ResourceOperation.Initialize);
|
||||
await Handle(ResourceOperation.Terminate);
|
||||
await Handle(ResourceOperation.Initialize);
|
||||
}
|
||||
else if (trigger == ResourceOperation.SystemInitialized)
|
||||
else if (operation == ResourceOperation.SystemReady)
|
||||
{
|
||||
filters = await Instance.Children<HttpFilter>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user