Sign in to follow this  
Followers 0
_Chris_

IP test

4 posts in this topic

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

Share this post


Link to post
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

#)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

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