sc4ry Posted April 9, 2010 Share Posted April 9, 2010 Hello, i have some problems by using TCPConnect. i try to ping an ip + port, which works, but the answertime is really long (>20.000ms). the TCPTimeout is normally set to 100ms, so i understand, if there is no answer within 100ms the TCPConnect should abort, but it does not do that. does anybody know, why? because that is not working, i thought about a way to exit the TCPConnect-Function, but i need help. I add a timer to the script and with the adblib-function i´m able to check, if there is "no reply" in maybe 5000 ms. but how to interrupt now tcpconnect? a little script for that: TCPStartup() $sock = "" $iport = "8888" Dim $Ip[2] $Ip[0] = 1 $Ip[1] = "211.117.64.66" For $i = 1 To $Ip[0] $timer = TimerInit() $sock = TCPConnect($IP[$i], $iPort) If Not @error Then ConsoleWrite("OK " & $ip & @TAB & Round(TimerDiff($timer), 2) & @CRLF) Else ConsoleWrite("Fail " & $ip & @TAB & Round(TimerDiff($timer), 2) & @CRLF) EndIf TCPCloseSocket($sock) Next Link to comment Share on other sites More sharing options...
JohnOne Posted April 9, 2010 Share Posted April 9, 2010 Hmmm. never used any of the TCP functionsBut at a wild guess I would try $sock = 0 to interrupt TCPConnect AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sc4ry Posted April 9, 2010 Author Share Posted April 9, 2010 Hmmm. never used any of the TCP functionsBut at a wild guess I would try $sock = 0 to interrupt TCPConnectThanks for your reply. I already use "if @error" ... but that is called after the TCPConnect is fishised (after 20.000 ms), what is much to long. I want to interrupt TCPConnect before finishing, WHEN its longer thant 5000 ms. Link to comment Share on other sites More sharing options...
trancexx Posted April 10, 2010 Share Posted April 10, 2010 There is nothing you can do. There is no option to set for that. There is no hidden solution. There is nothing available in AutoIt that could help you. Don't even bother trying. Eexcept for waiting. ...but you can wait with another process or, what is more advanced, in another thread. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
SoulA Posted April 10, 2010 Share Posted April 10, 2010 I feel like someone runs into this problem at least every week. Like trance said there is no solution based in autoit right now though I hope that there is some added functionality in future releases. Where can I request that sort of thing?Anyway, here is my suggestion. Start using the winpcap based UDF here. Basically it gives you a ton more options when dealing with packet sending/capturing since it is all winpcap based. It is obviously a bit more complicated but if you are doing a port scanner it should give you all you need. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 10, 2010 Share Posted April 10, 2010 (edited) Where can I request that sort of thing? You have the link to the Issue Tracker at the top of the page (BugTracker), but a search for TCPConnect shows that there already is a ticket for it, #1310 Edit: Or you could just have pressed on the "Bug Reports and Feature Requests" forum. Edited April 10, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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