ftpping()

The ftpping() call resolves a host name and sends a ping to the remote host to determine if the host is responding.

Syntax

#include <ftpapi.h>

int ftpping(host, len, addr)
char *host;
int len;
unsigned long *addr;

Parameters

host

len addr

Description

The ftpping() call tries to resolve the host name through a name server. If the name server is not present, ftpping() searches the TCPIP\ETC\HOSTS file for a matching host name. Unlike the ping() call, ftpping() could take several seconds because it must resolve the host name before it sends a ping. For this reason, use ftpping() only in the first try to determine if the host is responding. The ftpping() call sets the addr parameter to the internet address of the host. After the first try, use this address value to call ping.

If the ftpping() return value is positive, the return value is the number of milliseconds it took for the echo to return. If the return value is negative, it contains an error code. The parameter len specifies the length of the ping packet(s).

Return Values

The following are ftpping() call return codes and their corresponding descriptions:

Return Code

PINGREPLY PINGSOCKET PINGPROTO PINGSEND PINGRECV PINGHOST

Examples

int              rc;unsigned long    addr;

rc = ftpping("conypc", 256, &addr);

The ftpping() call sends a 256-byte ping packet to the host conypc.


[Back: ftpmkd()]
[Next: ftpproxy()]