7

Catching server timeout errors when using Flash Remoting

 3 years ago
source link: http://www.mikechambers.com/blog/2002/04/29/catching-server-timeout-errors-when-using-flash-remoting/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Catching server timeout errors when using Flash Remoting

Monday, April 29, 2002

When calling remote services / methods via Flash Remoting, any errors that occur will trigger the onStatus method to be called:

onStatus = function(error)
{
trace("Error : " + error.description);
}

However, if Flash cannot connect to the server (network or server is down) onStatus will not be called. Using XML and LoadVars you have to manually keep a timer in order to time out the connection, however you do not have to do this using Flash Remoting. Just create a method like the following:

_global.System.onStatus = function(info)
{
trace("details : " + info.details);
trace("description : " + info.description);
trace("code : " + info.code);
trace("level : " + info.level);
}

This method will be called if Flash MX cannot connect to the Flash Remoting server.
Here is an example output (when the server is not running):

details: http://localhost:8500/flashservices/gateway/
description: HTTP: Failed
code: NetConnection.Call.Failed
level: error

Couple of notes :

  • The exact messages may depend on the browser.
    • This will only works when connecting to the server via Flash Remoting. It will not work when using the XML or LoadVars object.</UL></p>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK