Jump to content

Ping Timeout


Recommended Posts

Hey in the beta version the "ping" command has an optional 'timeout' paramater but for me it doesn't seem to work. For example if i go-

Ping (www.sdfsdf4567nw436g.comG33Ta,5)

It takes much longer than 5ms to timeout (more like 1500 or so)...does this happen to anyone else?

Link to comment
Share on other sites

Hey in the beta version the "ping" command has an optional 'timeout' paramater but for me it doesn't seem to work. For example if i go-

Ping (www.sdfsdf4567nw436g.comG33Ta,5)

It takes much longer than 5ms to timeout (more like 1500 or so)...does this happen to anyone else?

Hi,

not to me. I think that 5 ms is too short. It will always take more than 5 ms doing a ping, I suppose.

Test:

$begin = TimerInit()
$var = Ping("www1.AutoItScript.com", 250)
Dim $error = @error
$dif = TimerDiff($begin)
If $var Then
    MsgBox(0, "Status", "Online, roundtrip was:" & $var)
Else
    Select
        Case $error = 1
            MsgBox(0, "Status", "An error occured with number: " & $error & " " & "Host is offline")
        Case $error = 2  
            MsgBox(0, "Status", "An error occured with number: " & $error & " " & "Host is unreachable")
        Case $error = 3  
            MsgBox(0, "Status", "An error occured with number: " & $error & " " & "Bad destination")
        Case $error = 4 
            MsgBox(0, "Status", "An error occured with number: " & $error & " " & "Other errors")
    EndSelect
EndIf
MsgBox(0, "Time Difference", Round($dif) & " ms")

Edit: Changed the script

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Well not really. This particular instance involves LAN pinging. When i go to the command prompt and ping something on the local network it usually responds with a time<1ms reply. Even if i increase it to somthing like 50 it still takes about 1.5 seconds for the autoit command to finish...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...