Ping Method

Pings the specified host and measures response time.


obj.Ping(Address String, Data String, RoundTripMs Long)
Where obj is an OpScrUtil.INet object.


Address Specifies the destination of the ping request.
Data Contains the data to send in the request.
RoundTripMs Number of milliseconds elapsed between sending the request and receiving the reply.

Return Type



To ping the server, raising an alert if the ping fails or it takes longer than 500 milliseconds, enter:

Set obj = CreateObject("OpScrUtil.INet")
bOK = obj.Ping("", varData, varRoundTripMs)
If bOK Then
If varRoundTripMs > 500 Then
'Raise an alert
End If
strError = obj.GetError()
'Create an alert
End If

This example shows how to ping a server and respond according to the response time.