SYNOPSIS


int ping(char *hostname);

The dbping() function issues an ICMP ping request to the specified host and times the duration of the request.

RETURN VALUES

Returns the number of milliseconds it takes the host to respond. -1 is returned in the event the host does not respond.

EXAMPLES

char *hostname = "www.microsoft.com";

msec = ping(hostname);
if (msec == -1)
    printf("Ping <I>%s<I> failed.", hostname);
else
    printf("Ping <I>%s<I> responded in %d msec.", hostname, msec);