[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

sendAndLoad Timeout

Posted on 2009-05-07
12
Medium Priority
?
600 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
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

656 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