Jump to content
Sign in to follow this  
Xand3r

TCPTimeout

Recommended Posts

Xand3r

Is TCPTimeout supposed to apply to TCPConnect too?

If so than why does this show 20 seconds for me?

TCPStartup()
#include <GUIConstants.au3>
Opt('TCPTimeout' , 100)
GUICreate('')
GUISetState()
$start = TimerInit()
$x=TCPConnect('86.55.211.38' , 65001)
MsgBox(0 ,@error ,"Socket: " & $x & @CRLF & "Time: " & Round(TimerDiff($start)/1000,2) & " seconds")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            TCPShutdown()
            Exit
    EndSelect
WEnd

I setup firewall so that it drops any attempt to connect to 65001 so in theory TCPConnect should take about 100 ms to report a failure right?


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

Share this post


Link to post
Share on other sites
trancexx

I think Opt('TCPTimeout' , ...) do nothing. That option is probably abandoned somewhere in the past.

Option you want to set is unsettable. And I don't mean AutoIt.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
tirom

Opt("TCPTimeout",10)

Global $out_txt

TCPStartup()
$iBeginTime = TimerInit()

$socket = TCPConnect("192.168.1.18", 8080)
If $socket <> -1 Then
    $out_txt = "Connect Successful! time-consuming: " & Round(TimerDiff($iBeginTime) / 1000, 4) & "sec"
Else
    $out_txt = "Connect Failed! time-consuming: " & Round(TimerDiff($iBeginTime) / 1000, 4) & "sec"
EndIf
TCPCloseSocket($socket)

ConsoleWrite($out_txt & @CRLF)
MsgBox(0, "", $out_txt)

The result: Connect Failed! time-consuming: 20.9968sec


Expo 2010 Shanghai China中国2010年上海世博会

Share this post


Link to post
Share on other sites
Tvern

Don't expect people to be too helpfull when you revive 4 old threads about a subject that is already filed as a known bug.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.