加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_镇江站长网 (https://www.0511zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

如何处理超时事件?

发布时间:2016-11-29 17:28:05 所属栏目:MySql教程 来源:网络整理
导读:如何处理超时事件? 1、IIS为一个死循的执行过程设定执行时间(缺省为90秒)超时事件: lt;%response.buffer=true%gt; lt;bodygt;lt;htmlgt; lt;% DO nbsp; counter=counter+1 nbsp; response.write counter "lt;brgt;" nbsp; response.flush LOOP %gt; lt

如何处理超时事件?


1、IIS为一个死循的执行过程设定执行时间(缺省为90秒)超时事件:
lt;%response.buffer=true%gt;
lt;bodygt;lt;htmlgt;
lt;%
DO
nbsp; counter=counter+1
nbsp; response.write counter "lt;brgt;"
nbsp; response.flush
LOOP
%gt;
lt;/bodygt;lt;/htmlgt;

2、自定义时间。用程序设定超时事件的时间段:
lt;%
response.buffer=true
server.scripttimeout=20
%gt;
lt;bodygt;lt;htmlgt;
lt;%
DO
nbsp; counter=counter+1
nbsp; response.write counter "lt;brgt;"
nbsp; response.flush
LOOP
%gt;
lt;/bodygt;lt;/htmlgt;

nbsp;

3、干涉超时时间段。捕获超时:
lt;%@ trANSACTION=Required%gt;
lt;%
response.buffer=true
server.scripttimeout=20
%gt;
lt;htmlgt;lt;bodygt;
lt;/bodygt;
lt;%
DO
nbsp; counter=counter+1
nbsp; response.write counter "lt;brgt;"
LOOP
response.flush
response.write "脚本运行完啦!"
%gt;
lt;/htmlgt;
lt;%
Sub OnTransactionAbort()
nbsp; nbsp; nbsp; response.clear
nbsp; nbsp; Response.Write "噢,脚本运行超时了!"
end sub
%gt;

nbsp;nbsp;nbsp; 4、绕过超时事件:
lt;%@ trANSACTION=Required%gt;
lt;%
response.buffer=true
server.scripttimeout=40
%gt;
lt;htmlgt;lt;bodygt;
lt;/bodygt;
lt;%
DOnbsp; UNTIL counter=400
nbsp; counter=counter+1
nbsp; response.write counter "lt;brgt;"
LOOP
response.flush
response.write "脚本运行完啦!"
%gt;
lt;/htmlgt;
lt;%
Sub OnTransactionAbort()
nbsp; nbsp; nbsp; response.clear
nbsp; nbsp; Response.Write "噢,脚本运行超时了!"
end sub
%gt;

nbsp;

(编辑:应用网_镇江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!