[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sendAndLoad Timeout

Posted on 2009-05-07
12
Medium Priority
?
602 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 total points
ID: 25407126
Any update???

CyanBlue
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

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