欢迎来到代码驿站!

当前位置:首页 >

如何处理超时事件?

时间:2021-06-26 08:47:24|栏目:|点击:

如何处理超时事件?


1
IIS为一个死循的执行过程设定执行时间(缺省为90秒)超时事件:
<%response.buffer=true%>
<body><html>
<%
DO
  counter=counter+1
  response.write counter & "<br>"
  response.flush
LOOP
%>
</body></html>

2、自定义时间。用程序设定超时事件的时间段:
<%
response.buffer=true
server.scripttimeout=20
%>
<body><html>
<%
DO
  counter=counter+1
  response.write counter & "<br>"
  response.flush
LOOP
%>
</body></html>

 

3、干涉超时时间段。捕获超时:
<%@ trANSACTION=Required%>
<%
response.buffer=true
server.scripttimeout=20
%>
<html><body>
</body>
<%
DO
  counter=counter+1
  response.write counter & "<br>"
LOOP
response.flush
response.write "
脚本运行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
      response.clear
    Response.Write "
,脚本运行超时了!"
end sub
%>

    4
、绕过超时事件:
<%@ trANSACTION=Required%>
<%
response.buffer=true
server.scripttimeout=40
%>
<html><body>
</body>
<%
DO  UNTIL counter=400
  counter=counter+1
  response.write counter & "<br>"
LOOP
response.flush
response.write "
脚本运行完啦!"
%>
</html>
<%
Sub OnTransactionAbort()
      response.clear
    Response.Write "
,脚本运行超时了!"
end sub
%>

 

上一篇:如何利用分析函数改写范围判断自关联查询详解

栏    目:

下一篇:docker 容器上编译 go 程序提示找不到文件问题

本文标题:如何处理超时事件?

本文地址:http://www.codeinn.net/misctech/148474.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有