Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

air - Flex HTTPService times out anyway

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>

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

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

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 ?

Edit: Using requetTimeout already.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...