wwHTTP::HttpPing

Use this method to 'ping' a Web site that is known to be up to check whether a valid Internet Connection can be made. You can specify a timeout value that determines how long this request runs and waits for finding the site in question.

o.HTTPPing(lnTimeout,lcUrl)

Return Value

.T. or .F. On error cErrorMsg is set with an error number string.

Parameters

lnTimeout
Timeout in seconds.

lcUrl
A fully qualified URL that you want to check.

Examples:
http://www.west-wind.com
https://www.west-wind.com:443/default.aspx

lcServer and lcLink
For backwards compatibility the lcUrl and lcLink parameters can be used to pass a server name and server relative page path.

Example:
Http.HttpPing(5,"www.west-wind.com","/default.asp")

Remarks

This routine is not a PING like operation, but it works only over the HTTP protocol. You can use this routine to check for an Internet Connection by accessing a known up site (such as Microsoft.com or Yahoo.com).

Example

oIP = CREATEOBJECT("wwHttp")

*** Optionally - set any oIP Connection options
oIP.cUsername = "ricks"
oIP.cPassword = "supersecret"

IF !oIP.HTTPPing(5,"http://www.west-wind.com/somepage.htm")
   MessageBox("No Connection")
   RETURN
ENDIF

See also:

West Wind Web Connection

© West Wind Technologies, 1996-2018 • Updated: 03/01/07
Comment or report problem with topic