Solved

sendAndLoad Timeout

Posted on 2009-05-07
12
575 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now