0
votes

On my AIR app, i use HTTPservice with PHP.

PHP side : set_time_limit(0)

Air side : httpService.requestTimeout = 0

it doesn't work, with httpService.requestTimeout = 0, there is a time out after 30s. The FaultEvent is dispatched, while php is still running. The PHP script goes to the end without problems.

So i changed to httpService.requestTimeout = 99999.

There is no longer time out after 30s but after 120s. And it's not the FaultEvent that is dispatched but the ResultEvent. And PHP is still running and goes to the end if I don't stop the server !! But I cannot know through my Air app when the service is completed.

I tried to add URLRequestDefaults.idleTimeout = 99999000

but still the same =/

Does anyone have an idea ? Thanks

1
Check with charles debugger for your php response and also see any warnings are there.Raja Jaganathan
There is no warning. Regardless of the PHP script or the computer, ResultEvent is dispatched after 120s.user1782822
Sometimes if php having any warnings immediately in flex side faulthandler will dispatch then later resulthandler will come from php.It happen sometimes so check with charles debugger in response and text tabRaja Jaganathan
Thanks for your answer. But there's no warning. All scripts stop after 120s. I use error_reporting(0), try catch, and a @ before each function too. I don't receive the faultevent, but directly the resultevent after 120s. So the httpservice is finished, but php is not.user1782822

1 Answers

0
votes

I've been fighting this issue as well. Add this code snippet before you send() your request:

URLRequestDefaults.idleTimeout = 120000;  // in millis so this setting would timeout after 120 seconds.

It seems as though there's a bug in the Flash Player for AIR (Flex uses a different one) that ignores responseTimeout on the HTTPRequest object. This sets the timeout properly.