无论如何,Flex HTTPService都会超时

gus*_*ino 2 apache-flex air httprequest

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

<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>
Run Code Online (Sandbox Code Playgroud)

这个操作需要比平时更长的时间,因此我将php的最大执行时间更改为120秒.

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

我已经检查了故障事件对象以获得答案,并在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

请求是否有执行时间限制?

编辑:requetTimeout已使用.

谢谢

gus*_*ino 9

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

但是设置一个非常全局的对象URLRequestDefaults属性idleTimeout可以正常工作.

我的问题的解决方案是此配置,位于应用程序的顶部.

import flash.net.URLRequestDefaults;

URLRequestDefaults.idleTimeout = 120000; //note this value represents milliseconds (120 secs)
Run Code Online (Sandbox Code Playgroud)

我相信这可以帮助别人.