flex air httpservice stream error and timing out

£可爱£侵袭症+ 提交于 2020-01-17 05:42:07

问题


We have an AIR client sending HTTPService Post request to Tomcat. The operation takes more than 30 seconds in the server since its a files transfer operation.

By the time the server returns the response, Flex is throwing a fault, 2032, stream error ( checked a lot on the net ) Looks like its timing out after 30 seconds, waiting for the Http response.

i tried setting ht.requestTimeout, it did not work. Setting URLRequestDefaults.idleTimeout also is not working. Looks like i have hit a dead end on this.

Solutions please...


回答1:


You need to increase HTTPService timeout using property requestTimeout

Provides access to the request timeout in seconds for sent messages. A value less than or equal to zero prevents request timeout.

you could also use its fault event to catch timeout, and proceed accordingly.

Hope that Helps




回答2:


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/13295537/flex-air-httpservice-stream-error-and-timing-out

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