Solved

sendAndLoad Timeout

Posted on 2009-05-07
12
584 Views
Last Modified: 2013-11-11
Hi,

I have a code that interacts with a webservice.

some requests may take up to 45 seconds to return, the problem is sendAndLoad gives up much sooner.

how can I set the timeout for sendAndLoad ?






thanks
request_obj.sendAndLoad

Open in new window

0
Comment
Question by:moshem
  • 5
  • 4
  • 3
12 Comments
 
LVL 37

Expert Comment

by:CyanBlue
ID: 24330149
You cannot set the timeout value in ActionScript...  Not sure what the solution is thought...

CyanBlue
0
 
LVL 4

Expert Comment

by:jeremyBass26
ID: 24342480
would something like this work... ?

// import the class:
import com.gskinner.net.LoadVars2;
myLV:LoadVars2 = new LoadVars2();
// subscribe to its data event:
myLV.addEventListener("data",this);
 
// add some data to send:
myLV.username = "frank";
myLV.password = "cheesepenguin";
 
// set the timeout period to 10 seconds (default is 7s):
myLV.timeout = 10000;
 
// this should timeout after 10 seconds:
myLV.sendAndLoad("http://1.1.1.1/noFile.php",myLV,"POST");
 
// function to handle the data event:
function data(p_evtObj:Object):Void {
   if (p_evtObj.src != undefined) {
      trace("Loaded successfully with source: "+p_evtObj.src);
    } else {
      trace("An error occurred while loading");
    }
}

Open in new window

0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 24375540
Interesting...  Never seen such class before...  Thanks, jeremyBass26...  ;)

CyanBlue
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 4

Expert Comment

by:jeremyBass26
ID: 24380530
wasn't sure if it'd fit the need here... Just trying to help and learn too hehe :D

cheers
jeremyBass
0
 
LVL 1

Author Comment

by:moshem
ID: 24392924
this is very nice, but this allows me to set a timeout that is smaller than the default one set by the parent class LoadVars..

which means if I can't extent the default timeout set by the parent, I am still out of luck here....

as the default  timeout is too short...
0
 
LVL 4

Expert Comment

by:jeremyBass26
ID: 24395615
but you should be able to loop and fake a new request...? just thinking out loud...
0
 
LVL 4

Expert Comment

by:jeremyBass26
ID: 24395632
wait... did you try to set is at a high number?

this is the code I put up

// set the timeout period to 10 seconds (default is 7s):
myLV.timeout = 10000;
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 24634951
It'd be nice if you could close this topic if you resolved the problem...  ;)

CyanBlue
0
 
LVL 1

Author Comment

by:moshem
ID: 24636021
Hey,

I didn't

I could not find a way to detect timeout... did you ?
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 24754596
It seems like what jeremyBass suggested should work???  If not, can you post the code you have tried???

CyanBlue
0
 
LVL 1

Author Comment

by:moshem
ID: 24766304
no, becuase after about 15, flash gives up and returns with an error, while actual timeout of the server could be 45 seconds
0
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
ID: 25407126
Any update???

CyanBlue
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FLV versus SWF 11 277
Action Script commands 5 239
bandwidth 5 71
Some You tube not working in IE11 on Windows 10 and 8.1 5 74
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question