Azazel Posted December 7, 2004 Share Posted December 7, 2004 (edited) Hi, and thx for your great Job. I know that this post is not really at the good place. But i have write a script that now is use by few persons. A bug continue to exist when a webpage don't answer. The script stay block and i can't stop it without CRTL+ALT+SUPP I have give "backround" parameter for the InetGet instruction. That's work perfectly is the page don't exist but block if the page don't answer. I don't want to make a second .exe too, for control of the download. I supply you to insert a timeout parameter for the InetGet if it's possible and not too complex Thank's very mutch Best Regards Aza Edited December 7, 2004 by Azazel Link to comment Share on other sites More sharing options...
jpm Posted December 7, 2004 Share Posted December 7, 2004 Hi, and thx for your great Job.I know that this post is not really at the good place.But i have write a script that now is use by few persons.A bug continue to exist when a webpage don't answer.The script stay block and i can't stop it without CRTL+ALT+SUPPI have give "backround" parameter for the InetGet instruction.That's work perfectly is the page don't exist but block if the page don't answer.I don't want to make a second .exe too, for control of the download.I supply you to insert a timeout parameter for the InetGet if it's possible and not too complexThank's very mutchBest RegardsAza<{POST_SNAPBACK}>did you see the background parameter and the @InetGetBytesRead , @InetGetActive macros? Link to comment Share on other sites More sharing options...
Azazel Posted December 7, 2004 Author Share Posted December 7, 2004 Yes JPM, i have seen and use this parameters, and as you can see in my post i have use the backround parameter too.You have already answer me for a long date before, see your message and your conclusion http://www.autoitscript.com/forum/index.ph...5131&hl=inetget :"> Link to comment Share on other sites More sharing options...
jpm Posted December 7, 2004 Share Posted December 7, 2004 Yes JPM, i have seen and use this parameters, and as you can see in my post i have use the backround parameter too.You have already answer me for a long date before, see your message and your conclusion http://www.autoitscript.com/forum/index.ph...5131&hl=inetget :"><{POST_SNAPBACK}>if your expectation is to have several download it is not possible due to the implementation. see docNote, only one download can be active at once, if you call the function again before a download is complete it will fail. Link to comment Share on other sites More sharing options...
Azazel Posted December 8, 2004 Author Share Posted December 8, 2004 (edited) if your expectation is to have several download it is not possible due to the implementation. see doc <{POST_SNAPBACK}>No jpm, i don't want several download in the same time, but one and another.The problem is not here, i'll try to explain in another way :Case with only one InetGet instruction in a scriptYou run Mozilla or IE with an URL.In case of the page you're asking for Exist but not responding, the brower give you a message after a few secondsNow you do the same thing with InetGet instruction with all parameter you want :The script block on the line InetGet and wait... with no possibility to stop it without CTRL+ALT+SUPPAnd here is my problem...Also, as the script is blocking, you have non possibility of tests with timer or else.However if the page not exist at all, no problem with the sriptI hope you understant better now the problemThx againAza Edited December 8, 2004 by Azazel Link to comment Share on other sites More sharing options...
jpm Posted December 8, 2004 Share Posted December 8, 2004 No jpm, i don't want several download in the same time, but one and another.The problem is not here, i'll try to explain in another way :Case with only one InetGet instruction in a scriptYou run Mozilla or IE with an URL.In case of the page you're asking for Exist but not responding, the brower give you a message after a few secondsNow you do the same thing with InetGet instruction with all parameter you want :The script block on the line InetGet and wait... with no possibility to stop it without CTRL+ALT+SUPPAnd here is my problem...Also, as the script is blocking, you have non possibility of tests with timer or else.However if the page not exist at all, no problem with the sriptI hope you understant better now the problemThx againAza<{POST_SNAPBACK}>You can use background=1 and have some logic in an Adlib functions testing @InetGetBytesRead.I don't know if after failure the @InetGetActive should be 0.Perhaps JON when it is back can answer this 0 setting or not. Link to comment Share on other sites More sharing options...
Azazel Posted December 8, 2004 Author Share Posted December 8, 2004 You can use background=1 and have some logic in an Adlib functions testing @InetGetBytesRead.I don't know if after failure the @InetGetActive should be 0.Perhaps JON when it is back can answer this 0 setting or not. <{POST_SNAPBACK}>background is already to 1 :"> Link to comment Share on other sites More sharing options...
jpm Posted December 8, 2004 Share Posted December 8, 2004 background is already to 1 :"><{POST_SNAPBACK}>put a sample of your script so I can help you Link to comment Share on other sites More sharing options...
Azazel Posted December 8, 2004 Author Share Posted December 8, 2004 This is an exemple of braking url, i have modify a little my script for running alone#include <GUIConstants.au3>$erreur=0$ReadAll=""$temp="Temp.html"$connect=InetGet ("http://tx2.us.unitedadmins.com/cdeath-dl.php",$Temp,1,1)$begin = TimerInit()While @InetGetActive$dif = TimerDiff($begin)if $dif>10000 then MsgBox(0,"Error","Error")$erreur=1 ExitLoopEndIf Wendif $erreur<>1 And @InetGetBytesRead<>-1 then $abc = FileReadAll ($Temp)DoFileDelete ($Temp)until FileExists($temp)=0EndIfFunc FileReadAll($File) $OpenFile = FileOpen($File, 0)if $OpenFile = -1 then MsgBox(0, "Error", "Unable to open file.") exitendif $ReadAll = FileRead($OpenFile, FileGetSize($File))if $ReadAll = -1 then MsgBox(0, "Error", "Error occur")GUIDelete ( )exitendifFileClose($OpenFile) Return $ReadAllEndFuncMsgBox(4096,'debug:' , '$ReadAll:' & $ReadAll) ;### Debug MSGBOXThx Link to comment Share on other sites More sharing options...
jpm Posted December 8, 2004 Share Posted December 8, 2004 This is an exemple of braking url, i have modify a little my script for running aloneThx<{POST_SNAPBACK}>does that work for you?$temp="Temp.html"$connect=InetGet ("http://tx2.us.unitedadmins.com/cdeath-dl.php",$Temp,1,1)$inactive=0$lastread=-1AdlibEnable("checkInetGetActive", 10000)while @InetGetActive sleep(500) if $inactive = 1 then msgbox(4096,"Download", "no Byte received") Exit EndIfWEndMsgBox(4096,'debug:' , '@InetGetBytesRead:' & @InetGetBytesRead) ;### Debug MSGBOX FileDelete ($Temp)if FileExists($temp) then msgbox(4096,"delete","too fast") ; should not be neededexitFunc checkInetGetActive() if $lastread = @InetGetBytesRead then $inactive=1 $lastread = @InetGetBytesReadEndFunc Link to comment Share on other sites More sharing options...
Azazel Posted December 9, 2004 Author Share Posted December 9, 2004 (edited) does that work for you?<{POST_SNAPBACK}>Thx jpm but now test this :Put an not existing URL like "http://www.test.com", in your own scriptand change the value : AdlibEnable("checkInetGetActive", 2000)You can see that nothing appears after 2 secondes After a moment you'll have the message @InetGetBytesRead=-1 because the URL don't existHowerver, if it was existing but not responding, the script would stay waiting... Ah bah j'avais pas vu que tu étais français, ca serait plus facile Je suis des Yvelines Edited December 9, 2004 by Azazel Link to comment Share on other sites More sharing options...
jpm Posted December 9, 2004 Share Posted December 9, 2004 Thx jpm but now test this :Put an not existing URL like "http://www.test.com", in your own scriptand change the value : AdlibEnable("checkInetGetActive", 2000)You can see that nothing appears after 2 secondes After a moment you'll have the message @InetGetBytesRead=-1 because the URL don't existHowerver, if it was existing but not responding, the script would stay waiting... Ah bah j'avais pas vu que tu étais français, ca serait plus facile Je suis des Yvelines<{POST_SNAPBACK}>My script is not perfect. I just try to illustrate the adlib mechanism. The logic must be improved to your expectation. right now my script just prove that nothing change in 10sec. Changing just 10sec to 2sec is not enought to prove that there is an activity or not. You need to have an adlib sampling of 500 and to count how much time you get the same value to decide.I hope you can improve the script A votre service Link to comment Share on other sites More sharing options...
Azazel Posted December 9, 2004 Author Share Posted December 9, 2004 I am going to be crasy jpm see and try that#include <GUIConstants.au3>$temp="Temp.html"AdlibEnable("checkInetGetActive", 2000)$connect=InetGet ("http://www.test.com",$Temp,1,1)Func checkInetGetActive()exitEndFunc InetGet block also the Adlib function Link to comment Share on other sites More sharing options...
SlimShady Posted December 9, 2004 Share Posted December 9, 2004 That shouldn't be happening and I agree that there has to be a timeout parameter. Link to comment Share on other sites More sharing options...
jpm Posted December 9, 2004 Share Posted December 9, 2004 I am going to be crasy jpm see and try thatInetGet block also the Adlib function <{POST_SNAPBACK}>Your script just prove that the inetget have terminate before the 2 seconds.try the foillowing you will see and adlib msgbox before the end message box.#include <GUIConstants.au3> $temp="Temp.html" AdlibEnable("checkInetGetActive", 500) $connect=InetGet ("http://www.test.com",$Temp,1,1) msgbox(4096,"return from Inetget",$connect) Func checkInetGetActive() msgbox(4096,"adlib","") EndFunc Link to comment Share on other sites More sharing options...
Azazel Posted December 9, 2004 Author Share Posted December 9, 2004 Thx for help jpm, i'll work around your last script to update mine. However i'm sure that a timeout parameter would be more efficient and easy to use Link to comment Share on other sites More sharing options...
jpm Posted December 10, 2004 Share Posted December 10, 2004 Thx for help jpm, i'll work around your last script to update mine.However i'm sure that a timeout parameter would be more efficient and easy to use <{POST_SNAPBACK}>Glad you canwork with current implementation. I leave to JON the final answer about timeout Link to comment Share on other sites More sharing options...
Azazel Posted December 12, 2004 Author Share Posted December 12, 2004 Hi jpm, this morning the url "http://tx2.us.unitedadmins.com/cdeath-dl.php", was block again So i have test your scripts, with different value of Adlib, nothing work Your script stay block indefinitely Link to comment Share on other sites More sharing options...
jpm Posted December 13, 2004 Share Posted December 13, 2004 Hi jpm, this morning the url "http://tx2.us.unitedadmins.com/cdeath-dl.php", was block again So i have test your scripts, with different value of Adlib, nothing work Your script stay block indefinitely <{POST_SNAPBACK}>I don't know what to say because this working ypur url is working again Link to comment Share on other sites More sharing options...
Azazel Posted December 14, 2004 Author Share Posted December 14, 2004 I don't know what to say because this working ypur url is working again <{POST_SNAPBACK}>I know jpm, that's the problem with this URL, sometime it's block for few minutes/hours, sometime it's normaly.In case of blocking again, i hope i would be able to contact you... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now