Arclite86 Posted October 10, 2015 Author Share Posted October 10, 2015 (edited) I have tried it I didnt really saw a big differentsso i used the ping method but still stook me a very long timeespecially when the url wasnt found or loading it can take up to 10 sec until it is done thats insane, there has to be a way to not skip the url when it takes longer than 1 secand it cant be the problem of my internet connection becasue If have 120mb internet speed. Edited October 10, 2015 by Arclite86 Link to comment Share on other sites More sharing options...
trancexx Posted October 10, 2015 Share Posted October 10, 2015 Of course. Use some other API. For example WinHTTP, for which you can set timeouts.Also, use HEAD HTTP method instead of GET. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Arclite86 Posted October 10, 2015 Author Share Posted October 10, 2015 I dont think i am looking for a timeout because this is my code right nowLocal $iPing = Ping($websiteread, 1000) If $iPing Then ; If a value greater than 0 was returned then display the following message. ConsoleWrite("exist! The roundtrip-time took: " & $iPing & "ms." & @CR) Else ConsoleWrite ($websiteread & " not Exists" & @CR)so the time out is already set to 1000 if am right this part:If $iPing Then ; If a value greater than 0 was returned then display the following message. ConsoleWrite("exist! The roundtrip-time took: " & $iPing & "ms." & @CR)works perfect 9/10 it detects the website in less than 20 milie seconds, how it should bebut when this part happensElse ConsoleWrite ($websiteread & " not Exists" & @CR)it can take up to 10 sec when my Local $iPing = Ping($websiteread, 1000)is only 1 secthis problebly is caused by loading the page and 9/10 it failsso if there is a way to not load it longer than 1sec the problems wil al be solved i have no experience with API and WINHTTP or HEAD HTTP so could you please help me with the script Link to comment Share on other sites More sharing options...
Arclite86 Posted October 10, 2015 Author Share Posted October 10, 2015 I am also trying to create an other method because there are allot of website that sometimes are the same so i came up to an idea when the url has passed the test it adds it to a list and every time before it does the ping method it first checks if its in the list of not than contineu to the ping method anyway, i am trying to creat this script but I need some help:expandcollapse popup$list1count = _GUICtrlListBox_GetCount($List1) $list1count4 = _GUICtrlListBox_GetCount($List4) For $idx=1 To $list1count ;my code bellow Local $i7 = 0 Do Local $asplit2 = $websiteurls iF $asplit2 Then _GUICtrlListBox_AddString($List2, GUICtrlRead($list1)) $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) If $iIndex4 = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) $lees4 = _GUICtrlListBox_GetCount($list2) GUICtrlSetData($Input2,$lees4) ContinueLoop Else ConsoleWrite("nietgevonden") EndIf Until $i7 = $list1count4 ;original code Local $iPing = Ping($websiteread, 1000) If $iPing Then ; If a value greater than 0 was returned then display the following message. ConsoleWrite("exist! The roundtrip-time took: " & $iPing & "ms." & @CR) _GUICtrlListBox_AddString($List4, $asplit2) _GUICtrlListBox_AddString($List2, GUICtrlRead($list1)) $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) $lees4 = _GUICtrlListBox_GetCount($list2) GUICtrlSetData($Input2,$lees4) Else ConsoleWrite ($websiteread & " not Exists" & @CR) $iIndex += 1 If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0 _GUICtrlListBox_SetCurSel($List1, $iIndex) $lees4 = _GUICtrlListBox_GetCount($list2) GUICtrlSetData($Input2,$lees4) EndIf Next Link to comment Share on other sites More sharing options...
kylomas Posted October 10, 2015 Share Posted October 10, 2015 Arclite,When i run it i have 1 to 2 second delay between web sites that are not found. If you are experiencing a delay with the code that i posted then rhe delay is elsewhere.I would strongly suggest that you pursue the direction that trancexx advised.Just curious, what are you trying to do?Kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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