Jump to content

IP test


_Chris_
 Share

Recommended Posts

I need code that will test a network connection, i have the ping command and i can get it to ping the gateway to test the connection but i want it to have a timeout to stop testing if the connection dosent work after 30 seconds. Or a cancel button to stop testing connection

Link to comment
Share on other sites

Read the helpfile!

Ping():

Ping

--------------------------------------------------------------------------------

Pings a host and returns the roundtrip-time.

Ping ( address or hostname [, timeout] )

Parameters

address/hostname Can be i.e. "www.hiddensoft.com" or "178.50.76.4".

timeout [optional] Is the time to wait for an answer in milliseconds (default is 4000).

Return Value

Success: Returns the roundtrip-time in milliseconds ( greater than 0 ).

Failure: Returns 0 if host is not pingable or other network errors occurred and sets @error. (See Remarks)

Remarks

When the function fails (returns 0) @error contains extended information:

1 = Host is offline

2 = Host is unreachable

3 = Bad destination

4 = Other errors

#)
Link to comment
Share on other sites

Sorry i did actually read the help file, i failed to recognise the function of the timeout

Ping ( address or hostname [, timeout] )

Parameters

address/hostname Can be i.e. "www.hiddensoft.com" or "178.50.76.4".

timeout [optional] Is the time to wait for an answer in milliseconds (default is 4000).

^^^^^

Did you see it now?

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