BinaryBrother Posted October 6, 2009 Share Posted October 6, 2009 I'm an a really bad Wifi connection, and when I try to use _InetGetSource() the entire program locks up for 2 or 3 mins... Is there a way to cause it to time-out or something, rather than hanging? On my PC I can replicate the hang using 2 lines of code, the include and the function it's self... Thanks for any replies. SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
99ojo Posted October 6, 2009 Share Posted October 6, 2009 (edited) I'm an a really bad Wifi connection, and when I try to use _InetGetSource() the entire program locks up for 2 or 3 mins... Is there a way to cause it to time-out or something, rather than hanging? On my PC I can replicate the hang using 2 lines of code, the include and the function it's self... Thanks for any replies. Hi, maybe you check first, how long it take, to open the url. You can set a timeout value for loading. It makes your script waiting at least the timeout value, but it is maybe better then 2 - 3 min. You may test the timeout value and change it for loading page. #include <IE.au3> $oIE = _IECreate ("myurl.domain.com", 0, 0, 0) ; loading url hidden, don't wait for page loading $var = _IELoadWait ($oIE, 0, 30000) ; wait for page loading -> timeout 30 sec _IEQuit ($oIE) If $var = 1 Then _InetGetSource("myurl.domain.com") Else MsgBox (0,"Timeout", "...loading page -> maybe bad connection!") EndIf ;-)) Stefan Edited October 6, 2009 by 99ojo 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