Command NET_Ping

4D Internet Commands

NET_Ping

version 6.8.1 (Modified)


NET_Ping (hostName; text; alive{; timeout}) Integer

ParameterTypeDescription
hostNameStringHost name or IP address
textTextText to send in ping
aliveInteger1 = Alive, 0 = Timeout/Inactive
timeoutInteger# of seconds to wait, 0 = use IT_SetTimeOut value

Function result Integer Error Code

Description

The NET_Ping command provides a mechanism to query a remote IP address to see if it is currently active. If the pinged machine is currently running the TCP/IP protocol and the network between the two sites is functional, an 'Alive' status should be returned. Typically, the pinged machine provides no indication to its user of the activity, assuming that the machine can respond to ping (ICMP Echo) requests.

NET_Ping will ping a machine specified by either a host name or IP address. Any machine with an IP address that is accessible via the network can be pinged. This includes end-user machines. [Some security systems known as "firewalls" may hinder you from pinging machines under their protection.]

hostName is the host name or IP address of the machine to ping.

text is the text to send in the ping. The text parameter exists only to effect the size of the TCP packet being sent as the Ping command is executed.

alive is the integer returned corresponding to the state of the machine pinged. A value of 1 indicates the machine is alive. A value of zero indicates the machine is either inactive or the ping timed out before a response was received.

timeout specifies the number of seconds this command will wait for the Ping to complete. This is an optional parameter which, if not supplied, will default to zero. A zero value in this parameter will cause the command timeout if a response is not received by the number of seconds specified with the IT_SetTimeOut command.

Note: This parameter is not taken into account under Windows 95/98 and Millennium.

See Also

IT_SetTimeOut.