Flex HTTPService 无论如何都会超时 [英] Flex HTTPService times out anyway

查看:33
本文介绍了Flex HTTPService 无论如何都会超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在执行此服务 30 秒后收到错误

I'm getting an error after 30 seconds of execution of this service

<s:HTTPService id="svcList" url="http://localhost/index.php" method="GET" result="svcList_resultHandler(event)" fault="svcList_faultHandler(event)" requestTimeout="300">
    <s:request xmlns="">
        <mod>module</mod>
        <op>operation</op>
    </s:request>
</s:HTTPService>

此操作比平时花费的时间更长,所以我将 php 的最大执行时间更改为 120 秒.

This operation takes longer than usual so I changed the max execution time for php to 120 seconds.

脚本在通过浏览器请求时正确运行,即 http://localhost/index.php?mod=module&op=operation

The script runs correctly when is requested through a browser i.e http://localhost/index.php?mod=module&op=operation

我已经检查了错误事件对象的答案并在 faultDetails 中找到了这个 错误:[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/index.php"errorID=2032].网址:http://localhost/index.php

I've already checked the fault event object for an answer and find this at faultDetails Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/index.php" errorID=2032]. URL: http://localhost/index.php

请求有执行时间限制吗?

Is there a execution time limit for requests ?

已经使用 requetTimeout.

谢谢

推荐答案

好的,在我的工作环境 (Flex SDK 4.1 - AIR 2.6) 只需使用 requestTimeout="xx"代码>不起作用,我不知道为什么.

Ok, in my working environment (Flex SDK 4.1 - AIR 2.6) simply using requestTimeout="xx" doesn't work I don't know why.

但是设置一个非常全局的对象 URLRequestDefaults 属性 idleTimeout 可以根据我的需要工作.

But setting a very global object URLRequestDefaults property idleTimeout works as I need.

我的问题的解决方案是这个配置,在应用程序的顶部.

The solution for my proble is this configuration, at the top of the application.

import flash.net.URLRequestDefaults;

URLRequestDefaults.idleTimeout = 120000; //note this value represents milliseconds (120 secs)

我相信这可以帮助某人.

I believe this could help somebody.

这篇关于Flex HTTPService 无论如何都会超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆