Jump to content
Sign in to follow this  
evilertoaster

Ping Timeout

Recommended Posts

evilertoaster

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?

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
evilertoaster

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...

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.