RemoteObject - request timeout

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RemoteObject - request timeout

alanmorehead79
Does anyone have an example of how to handle a request timeout for a
remote data service?

I have a RemoteObject in my app and it has a requestTimeout property.
Does this dispatch an event when the timeout occurs?

<mx:RemoteObject id="myService" requestTimeout="10"
endpoint="http://localhost" destination="TestService"
fault="onFault(event);" showBusyCursor="true">

I could create a timer that is started when the invoke event is fired,
but what would the point of the requestTimeout property be then?


Reply | Threaded
Open this post in threaded view
|

RE: RemoteObject - request timeout

Seth Hodgson
The requestTimeout property triggers the component (a RemoteObject in this case) to give up waiting for a result or fault response from the remote server and generates a fault locally on the client. So you'll be able to handle this in your general fault handler and you can watch for these; they'll have a faultCode of Client.Error.RequestTimeout.

This property is useful if your component is making an idempotent (read-only) request for data or is sending a notification that can be safely resent. If a request times out you can safely retry it.

If you use this when you make a call that modifies, creates or deletes data on the server and the request times out you should query the server for its current state before attempting to retry the call.

HTH,
Seth

________________________________________
From: [hidden email] [mailto:[hidden email]] On Behalf Of alanmorehead79
Sent: Thursday, February 22, 2007 10:36 AM
To: [hidden email]
Subject: [flexcoders] RemoteObject - request timeout

Does anyone have an example of how to handle a request timeout for a
remote data service?

I have a RemoteObject in my app and it has a requestTimeout property.
Does this dispatch an event when the timeout occurs?

<mx:RemoteObject id="myService" requestTimeout="10"
endpoint="http://localhost" destination="TestService"
fault="onFault(event);" showBusyCursor="true">

I could create a timer that is started when the invoke event is fired,
but what would the point of the requestTimeout property be then?
 
Reply | Threaded
Open this post in threaded view
|

Re: RemoteObject - request timeout

Roms8313
This post has NOT been accepted by the mailing list yet.
In reply to this post by alanmorehead79
We ran into the same issue this week, having to send a custom file format as a ByteArray along with some custom mapped AS3 value objects to Zend AMF (knowing the file size can range from 100Ko to over 5Mo and request was systematically shut after 8-9 seconds on a Windows 10 desktop computer).

The solution is in fact to set two properties with the same value on the channel of your RemoteObject.
Let's say you instantiate it programmatically :

var remote : RemoteObject = new RemoteObject("zendamf");

var channel : AMFChannel = new AMFChannel ( "zendamf-application-endpoint", "http://domain.com/services/application/public/amf" );
channel.connectTimeout = 150; // seconds
channel.requestTimeout = 150; // seconds

var channelSet : ChannelSet = new ChannelSet();
channelSet.addChannel(channel);

remote.channelSet = channelSet;
remote.source = "AMF_Service";

Hope this helps !