moshem
asked on
sendAndLoad Timeout
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
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
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");
}
}
Interesting... Never seen such class before... Thanks, jeremyBass26... ;)
CyanBlue
CyanBlue
wasn't sure if it'd fit the need here... Just trying to help and learn too hehe :D
cheers
jeremyBass
cheers
jeremyBass
ASKER
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...
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...
but you should be able to loop and fake a new request...? just thinking out loud...
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;
this is the code I put up
// set the timeout period to 10 seconds (default is 7s):
myLV.timeout = 10000;
It'd be nice if you could close this topic if you resolved the problem... ;)
CyanBlue
CyanBlue
ASKER
Hey,
I didn't
I could not find a way to detect timeout... did you ?
I didn't
I could not find a way to detect timeout... did you ?
It seems like what jeremyBass suggested should work??? If not, can you post the code you have tried???
CyanBlue
CyanBlue
ASKER
no, becuase after about 15, flash gives up and returns with an error, while actual timeout of the server could be 45 seconds
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CyanBlue