Sign in to follow this  
Followers 0
autoitxp

TCPConnect Timout

5 posts in this topic

Hi

how can i reduce tcpconnect timeout it took almost 15 sec to check connection if fails .

can we check this in 5 secs or less ?

TCPStartUp()
$socket = TCPConnect(TCPNameToIP($g_IP),$port)
If $socket - 1 Then

Share this post


Link to post
Share on other sites



Look in help file for TCPTimeout

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Opt("TCPTimeout",1)

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

Edited by tirom

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You posted your question now 5 times in 5 different threads.

Next time you will get some forced time off as this behaviour is not acceptable here.

mm Even posted your so called problem in a feature request in TRAC.. Is anything on fire or something?

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Sorry!

but who can tell me witch function influenced by this option?

Opt("TCPTimeout",100)


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

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  
Followers 0