Flex Air - HTTPService TimeOut every time

别来无恙 提交于 2019-12-12 04:34:02

问题


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:


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.



来源:https://stackoverflow.com/questions/13858053/flex-air-httpservice-timeout-every-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!