Blue Sky
Blue Sky

Reputation: 827

flex air httpservice stream error and timing out

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

Upvotes: 0

Views: 924

Answers (2)

Doug P.
Doug P.

Reputation: 55

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.

Upvotes: 0

Imran
Imran

Reputation: 3024

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

Upvotes: 1

Related Questions