1.优化了平移缩放逻辑

2.优化了触发器的执行,优化了节点执行时的代码逻辑
3.优化了节点方法委托的参数获取
This commit is contained in:
fengjiayi
2024-09-18 16:45:41 +08:00
parent 9041be139f
commit 5e246adf52
13 changed files with 632 additions and 753 deletions

View File

@@ -40,8 +40,23 @@ namespace Serein.Library.Web
}
listener.Prefixes.Add(prefixe); // 添加监听前缀
listener.Start(); // 开始监听
try
{
listener.Start(); // 开始监听
Task.Run(async () =>
{
while (listener.IsListening)
{
var context = await listener.GetContextAsync(); // 获取请求上下文
ProcessRequestAsync(context); // 处理请求
}
});
}
catch(Exception ex)
{
listener = null;
Console.WriteLine(ex);
}
//_ = Task.Run(async () =>
//{
@@ -58,14 +73,7 @@ namespace Serein.Library.Web
// }
//});
Task.Run(async () =>
{
while (listener.IsListening)
{
var context = await listener.GetContextAsync(); // 获取请求上下文
ProcessRequestAsync(context); // 处理请求
}
});
return this;
}
@@ -115,8 +123,8 @@ namespace Serein.Library.Web
// 停止服务器
public void Stop()
{
listener.Stop(); // 停止监听
listener.Close(); // 关闭监听器
listener?.Stop(); // 停止监听
listener?.Close(); // 关闭监听器
}
}