faustf Posted April 28, 2016 Share Posted April 28, 2016 hi guy how is possible reduce a timing of scanning ip ?? example i have a lan, i want scan for find open port 3356 , start 192.168.1.1 to 192.168.1.255 , how is possible reduce a probing time ?? of TCPConnect ?? AutoBert 1 Link to comment Share on other sites More sharing options...
Trong Posted April 28, 2016 Share Posted April 28, 2016 Opt('TCPTimeout', 100) Regards, Link to comment Share on other sites More sharing options...
faustf Posted April 28, 2016 Author Share Posted April 28, 2016 100 is one second ??? Link to comment Share on other sites More sharing options...
InunoTaishou Posted April 28, 2016 Share Posted April 28, 2016 100 is 100 milliseconds, or 1/10th of a second. 1000 is one second. Link to comment Share on other sites More sharing options...
Trong Posted April 28, 2016 Share Posted April 28, 2016 (edited) 32 minutes ago, faustf said: 100 is one second ??? Opt("TCPTimeout", 100) ;100 milliseconds ; 1seconds=1000 milliseconds Eg: expandcollapse popupOpt('TCPTimeout', 50) Global $hGUI = GUICreate("Autoit Port Scanner", 300, 175) GUICtrlCreateGroup("Port Scan", 5, 5, 275, 160) GUICtrlCreateLabel("IP", 20, 17) Global $hcIPAddress = GUICtrlCreateInput(@IPAddress1, 20, 33, 125) GUICtrlCreateLabel("Start on Port", 20, 55) Global $hcPortStart = GUICtrlCreateInput("1", 20, 68, 125) GUICtrlCreateLabel("End on Port", 20, 91) Global $hcPortEnd = GUICtrlCreateInput("65353", 20, 108, 125) Global $hcStartScan = GUICtrlCreateButton("Start", 20, 135, 125) GUICtrlSetFont($hcStartScan, 12) Global $hcOnPort = GUICtrlCreateLabel("Scanning Port: None", 150, 142) GUICtrlCreateGroup("Open Ports", 160, 17, 105, 125) Global $hcOpenPortList = GUICtrlCreateList("", 168, 30, 90, 109) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case -3 ExitLoop Case $hcStartScan _StartScan(GUICtrlRead($hcIPAddress), GUICtrlRead($hcPortStart), GUICtrlRead($hcPortEnd)) EndSwitch WEnd Func _StartScan($sIPScan = "127.0.0.1", $sPortStart = 1, $sPortEnd = 65353) TCPStartup() Local $sSoketID Local $sTimeStart = TimerInit() For $LetsGo = $sPortStart To $sPortEnd GUICtrlSetData($hcOnPort, "Scanning Port: " & $sPortStart) $sSoketID = TCPConnect($sIPScan, $sPortStart) If $sSoketID > 0 Then GUICtrlSetData($hcOpenPortList, $sPortStart) $sPortStart = $sPortStart + 1 Next TCPShutdown() Local $sTimeEnd = TimerDiff($sTimeStart) TrayTip("Port Scanner", "Done Process took " & Round($sTimeEnd, -1) / 1000 & " seconds", 7, 1) EndFunc ;==>_StartScan Edited April 28, 2016 by VIP Eg Regards, Link to comment Share on other sites More sharing options...
faustf Posted April 28, 2016 Author Share Posted April 28, 2016 thankz Link to comment Share on other sites More sharing options...
faustf Posted April 28, 2016 Author Share Posted April 28, 2016 i try to use and also test your script , change the number 50 to 1000 but not see differnce Link to comment Share on other sites More sharing options...
Trong Posted April 29, 2016 Share Posted April 29, 2016 2 hours ago, faustf said: i try to use and also test your script , change the number 50 to 1000 but not see differnce if your server is turned on, it works too slowly, try increasing the delay time in opt! For example, that you open an FTP server on port 21 and WebServer at port 80 You set the starting port is 1, and the end port is 100. After the scan will show: 21 and 80 in the list of ports! Regards, Link to comment Share on other sites More sharing options...
faustf Posted April 29, 2016 Author Share Posted April 29, 2016 thankz for suggest , but in my case i have this scenario: i want check only port 3356 , the server stay on in many pc of my lan, i want discover with scan how many pc of my lan are open, therfore the tcpconnet , probe one time , and go out ,(like a ping , i hope explain a sense) , because when is open the answer at host is immidiatly i mesure with timediff, and is : 1.53287638512716 , but when host is closed the time is 21001.9468954853, i want if possible, reduce this timing after 2. or 3. must answer me with host down and start next ip thankz at all for support Link to comment Share on other sites More sharing options...
faustf Posted April 29, 2016 Author Share Posted April 29, 2016 i find other discussion about this problem here https://www.autoitscript.com/forum/topic/127415-tcpconnect-sipaddr-iport-itimeout/ i understund , tcpconnect not have timing setable , but exist some solution Link to comment Share on other sites More sharing options...
funkey Posted April 29, 2016 Share Posted April 29, 2016 I solved this using my socket_UDF. https://www.autoitscript.com/forum/topic/151933-another-tcp-server-written-with-my-socket_udf/ Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
faustf Posted April 29, 2016 Author Share Posted April 29, 2016 thank is very good work i try to understund thankz so much Link to comment Share on other sites More sharing options...
faustf Posted April 29, 2016 Author Share Posted April 29, 2016 i fund a bug when i run a TCP Example server for socket_UDF.au3 and run client i connect send somthing , and go ok but if i push disconnect , start to write in console Data received: in loop and if i try to reconnect not work, i must stop 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