VB DLL 忽略脚本超时

发布于 2024-10-02 06:37:08 字数 464 浏览 1 评论 0原文

非常简单:我在确保 VB DLL 遵守 IIS 和 ASP 中设置的超时时遇到问题。

我工作的一个网站使用了许多自制的 DLL,它们的方法可能运行的时间比 Web 用户愿意等待的时间要长。如果访问者按 Esc 键或关闭浏览器,则该过程自然会在服务器上继续,从而占用 CPU 时间和内存。

在我的 ASP 中,我将 server.scriptTimeout 设置为一个较低的数字(假设为 10 秒),并且我在 IIS 中为整个 Web 应用程序做了同样的事情(因为我知道如果 server.scriptTimeout 低于 IIS,则它会被忽略)暂停)。

如果我运行 ASP 页面,其中除了运行几百万次的循环之外什么都没有,那么脚本确实正确超时,即 10 秒后。但是,如果我将该循环移至一个非常简单的 DLL(然后使用 COM+ 正确注册),那么我的脚本将运行大约 210 秒,然后超时。

所以我的问题是:如何让脚本按照我的要求超时?

Very briefly: I'm having an issue with ensuring that VB DLLs honour the timeouts set in IIS and ASP.

A site I work on uses a number of home-rolled DLLs and their methods could, potentially, run for longer than a web user is willing to wait. If the visitor presses Escape or closes their browser then the process naturally continues on the server, sucking up CPU time and memory.

In my ASP I have set server.scriptTimeout to a low number (let's say 10 seconds) and I've done the same thing in IIS for the whole web app (because I know server.scriptTimeout is ignored if it is lower than the IIS timeout).

If I run my ASP page with nothing in it but a loop that runs a few million times then the script does time out properly ie after 10 seconds. However, if I move that loop into a very simple DLL (which is then registered properly with COM+) then my script runs for about 210 seconds before timing out.

So my question is: how can I make the script time out as I have asked it to?

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

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

发布评论

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

评论(1

习惯成性 2024-10-09 06:37:08

据我了解,ASP 引擎在调用 DLL 中的方法时会将控制权传递给 DLL。在该方法返回之前,ASP 并不是真正在发号施令,一旦调用返回,它就会意识到时间已超过并结束脚本执行。

As I understand it the ASP engine passes control to the DLL when it makes the call to a method in a DLL. Until the method returns, ASP is not actually calling the shots, once the call returns, it realized that the time has exceeded and ends the script execution.

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