Xand3r Posted October 15, 2008 Posted October 15, 2008 TCPStartup() For $i=1 To 65000 $con=TCPConnect("127.0.0.1",$i) If $con=-1 Then MsgBox(0 , "" , $i) Else If Not Mod($i,100) Then ToolTip($i&@TAB&":"&@TAB&$con,0,0) TCPCloseSocket($con) EndIf Next So this script in au3 form does not show even one msgbox for me but if compiled works fine any ideea what could cause this behavior because earlyer today the script worked fine (well not this one this is a mock-up ) my environment : xp vista sp1 autoit version : 3.2.12.1 Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
SoulA Posted October 15, 2008 Posted October 15, 2008 If I do this I only get a message box on the open ports... TCPStartup() $ip = "127.0.0.1" For $i = 1 To 65000 $con = TCPConnect($ip, $i) If $con <> -1 Then MsgBox(0 , "" , $i) TCPCloseSocket($con) EndIf Next Func OnAutoItExit() TCPShutdown() EndFunc
Xand3r Posted October 16, 2008 Author Posted October 16, 2008 dude i know what my script does but i think you missunderstood my problem i'm 100% sure that not the script itself is the problem because when i run it in au3 form all my ports seem to be open(they are not!) and if i run it in compiled form it works fine (msgbox on ports that are open) Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
trancexx Posted October 16, 2008 Posted October 16, 2008 For $i=1 To 65000 - that would take like forever to check doing it this way. How long did it take you to check all ports? ♡♡♡ . eMyvnE
Xand3r Posted October 16, 2008 Author Posted October 16, 2008 2-3 mins Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
trancexx Posted October 16, 2008 Posted October 16, 2008 2-3 minsThat is strange. Try this: HotKeySet("{Esc}", "_Exit") $start = TimerInit() TCPStartup() For $i=1 To 65000 $con=TCPConnect("127.0.0.1",$i) If $con=-1 Then ToolTip("Port:" & @TAB & @TAB & "$con" & @CRLF & $i & @TAB & ":" & @TAB & $con & @CRLF & @CRLF & " Press ESC to exit") Else MsgBox(0 , "$con = " & $con, "$port " & $i) TCPCloseSocket($con) EndIf Next Func _Exit() ToolTip("") MsgBox(0 , "Elapsed time", TimerDiff($start) / 1000 & " sec" & @CRLF & @CRLF & "Number of tested ports: " & $i) Exit EndFunc I get one port per second. And you, apparently, 1000. Is it? ♡♡♡ . eMyvnE
SoulA Posted October 16, 2008 Posted October 16, 2008 He could have changed the TCPTimeout option? Anyway the script worked as it was supposed to when I was running it in either script form or compiled for me.
trancexx Posted October 16, 2008 Posted October 16, 2008 He could have changed the TCPTimeout option?Anyway the script worked as it was supposed to when I was running it in either script form or compiled for me.What is set by TCPTimeout option? ♡♡♡ . eMyvnE
SoulA Posted October 16, 2008 Posted October 16, 2008 (edited) I thought it changed how fast the TCPConnect and TCPSend functions time out but apparently not. In my tests I get a port a second as well. My code... Opt("TCPTimeout",20) TCPStartup() $ip = "127.0.0.1" For $i = 1 To 65000 $time = TimerInit() $con = TCPConnect($ip, $i) If $con <> -1 Then MsgBox(0, "", $i) TCPCloseSocket($con) EndIf MsgBox(0, "", round(TimerDiff($time)) / 1000) Next Func OnAutoItExit() TCPShutdown() EndFunc Edited October 16, 2008 by SoulA
Xand3r Posted October 16, 2008 Author Posted October 16, 2008 i did not touch the tcp timeout and in compiled form i get about 1-2 ports a second(because they timeout) in au3 form i get 1000/second because THE SOCKETS CONNECT but it seams like you guys don't understand what i'm saying here's the noobes form i can say it in: tcpconnect on a closed port returns a socket number :| Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
martin Posted October 16, 2008 Posted October 16, 2008 i did not touch the tcp timeout and in compiled form i get about 1-2 ports a second(because they timeout)in au3 form i get 1000/second because THE SOCKETS CONNECT but it seams like you guys don't understand what i'm sayinghere's the noobes form i can say it in:tcpconnect on a closed port returns a socket number :|I think we know what you're saying. The problem is (your problem is) that other people don't get the same result. I don't for example. So complaining that people aren't listening to you or don't understand seems stupid when you don't listen to or don't understand their replies. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
scriptjunkie Posted October 16, 2008 Posted October 16, 2008 (edited) I copied and pasted into scite. Hit F5. I get a message box for every port, firewall off. Edited October 16, 2008 by scriptjunkie
Xand3r Posted October 16, 2008 Author Posted October 16, 2008 (edited) ok i'm sorry but you all presumed i was doing something wrong :| a couple of days ago the script worked just fine and i had a simple question how is it possible that when you TCPConnect to the loopback ip and a port that is closed you get a socket :| (firewall off!) [qoute] I get one port per second. And you, apparently, 1000. Is it? Edited October 16, 2008 by TheMadman Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro
martin Posted October 16, 2008 Posted October 16, 2008 ok i'm sorry but you all presumed i was doing something wrong :|a couple of days ago the script worked just fineand i had a simple questionhow is it possible that when you TCPConnect to the loopback ip and a port that is closed you get a socket :| (firewall off!)I don't know.I had a problem 2 days ago with ZoneAlarm. After about 5 minutes I couldn't get internet access to sites, though my email worked and ftp worked. The only way I could connect again was to reboot and then I got another 5 mninutes. Same problem if I turned off my firewall. After trying lots of very complicated advice I uninstalled ZoneAlarm and reinstalled it and the problem has gone. I suspect, but don't know, that my problem was caused by (another) duff ZoneAlarm automatic update. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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