gpt4 book ai didi

asp-classic - 为 ServerXMLHTTP 请求设置超时

转载 作者:行者123 更新时间:2023-12-03 22:40:17 25 4
gpt4 key购买 nike

有谁知道如何设置 ServerXMLHTTP 请求超时时的默认操作?我正在使用 setTimeouts() 根据 MSDN site 设置超时选项.

理想情况下,我想从头开始再次初始化请求,或者在超时时刷新页面。

我正在使用经典的 asp 和 jscript。

这是我的要求:

function serverXmlHttp(url) {
var serverXmlHttp;
serverXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP.6.0");

// set time out options
serverXmlHttp.setTimeouts(15000,15000,15000,15000);

// does not work
// serverXmlHttp.ontimeout(Response.Write("page has timed out"));

serverXmlHttp.open("GET", url, false);
serverXmlHttp.send();

if (serverXmlHttp.readyState == 4) {
return serverXmlHttp.responseText;
}
}

最佳答案

重要的是找出它为什么超时..

远程 URL 是否与调用页面在同一个应用程序上?

如果是这样,请查看 INFO: Do Not Send ServerXMLHTTP or WinHTTP Requests to the Same Server 因为您将面临线程饥饿..

关于asp-classic - 为 ServerXMLHTTP 请求设置超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3927825/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com