通过 XSP2 运行守护程序有任何问题吗?

发布于 2024-07-06 22:30:05 字数 215 浏览 9 评论 0原文

我们希望使用 Mono 2.0(或更高版本)运行一个通过 ASMX 公开自身的守护进程。 我们考虑的是在 Application_Start 事件中启动一个守护线程,而不是处理 ASP.NET 托管 API。 XSP2 不应重新启动应用程序域,因此我们的守护进程将是安全的。

这有什么缺点吗(除了有点奇怪)? 还有其他方法可以让我们的代码在与 ASMX 请求相同的应用程序域中运行吗?

We want to run a daemon that exposes itself via ASMX, using Mono 2.0 (or later). Instead of dealing with the ASP.NET hosting APIs, we're thinking about just starting a daemon thread in the Application_Start event. XSP2 shouldn't restart the appdomain, so our daemon will be safe.

Are there any downsides to this (besides being a bit odd)? Any other approaches that allow us to have our code running in the same appdomain as the ASMX requests?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┊风居住的梦幻卍 2024-07-13 22:30:06

当您可以构建 shell 控制台应用程序(使用相同的代码或接受参数)时,为什么需要 XSP 通过调用 ASXM 来运行守护程序? 它可以在终端中调用,也可以从任何 shell 脚本中调用并添加到 cron 中。 简单,不需要服务器来执行此操作。

如果您想这样做,而不是像我那样做,您可以设置一个基本服务器实例(使用 nginx、lighty 或 apache),在某个内部端口中列出,将该服务器添加到虚拟主机和 cron/shell 脚本上你可以做

WGET http://dummyhost/mydaemon.asmx

Why do need XSP to run a daemon through calling an ASXM when you can just build a shell console application (with the same code or accepting arguments)? That can be called in terminal or called from any shell script and added to cron. Simple no server required to do this.

If you want to do this, not the way I would do it, you can setup a basic server instance (using nginx, lighty or apache) listing in a certain internal port, add that server to a dummy host and on cron/shell script you can do

WGET http://dummyhost/mydaemon.asmx
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文