0

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...

Blue Sky
  • 807
  • 1
  • 15
  • 36
  • Is the flex request timing out; or is the server request timing out? – JeffryHouser Nov 08 '12 at 19:14
  • Its on the Air side. We have set a large timeout on Tomcat. The client shows a stream error, 2032 after 30 seconds. tried upgrading to latest AIR. Didn't help. This is critical and we need to fix it. Please let me know if there is a way out... – Blue Sky Nov 08 '12 at 19:20
  • I'm not sure; I know I've had longer requests (~1 minute) using AMF without timeouts. Hopefully someone else more knowledgeable can chime in. – JeffryHouser Nov 08 '12 at 19:51
  • @Vish I encountered same problem. Were you able to resolve the issue? My air client fails because of the request time out. – user3123690 Sep 29 '14 at 18:38

2 Answers2

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

Imran
  • 2,906
  • 1
  • 19
  • 20
  • Setting the HTTPService timeout, requestTimeout has no effect. We have tried that many times with various values. It just times out after 30 seconds. – Blue Sky Nov 12 '12 at 08:12
0

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.

Doug P.
  • 45
  • 6