home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Komunik / sambar / sambar51p.exe / syshelp / cscript / funcs / PING.HTM < prev    next >
Encoding:
Text File  |  2002-01-05  |  639 b   |  23 lines

  1. <H3>SYNOPSIS</H3>
  2. <BR>
  3.      int ping(char *hostname);
  4. <BR>
  5. <BR>
  6. The dbping() function issues an ICMP ping request to the specified host
  7. and times the duration of the request.
  8. <BR>
  9. <H3>RETURN VALUES</H3>
  10. Returns the number of milliseconds it takes the host to respond.
  11. -1 is returned in the event the host does not respond.
  12. <P>
  13. <H3>EXAMPLES</H3>
  14. <BLOCKQUOTE><CODE><PRE>
  15. char *hostname = "www.microsoft.com";
  16.  
  17. msec = ping(hostname);
  18. if (msec == -1)
  19.     printf("Ping <I>%s<I> failed.", hostname);
  20. else
  21.     printf("Ping <I>%s<I> responded in %d msec.", hostname, msec);
  22. </PRE></CODE></BLOCKQUOTE>
  23.