Jump to content

Recommended Posts

Posted

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
  • 2 years later...
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年上海世博会

  • Developers
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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

Sorry!

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

Opt("TCPTimeout",100)

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

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
×
×
  • Create New...