Solved

sendAndLoad Timeout

Posted on 2009-05-07
12
593 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

688 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