PING
Windows supports an Internet Control Message Protocol (ICMP) to determine whether or not a particular host is available. ICMP is a network layer protocol that delivers flow control, error messages, routing, and other data between Internet hosts. ICMP is primarily used by application developers for a network ping.A ping is the process of sending an echo message to an IP address and reading the reply to verify a connection between TCP/IP hosts. If you are writing new application you will be better to use the Winsock 2 raw sockets support, implemented in , for example.
Please note, however, that for Windows NT and Windows 2000 implementations, Raw Sockets are subject to security checks and are accessible only to members of the administrator's group. Icmp.dll provides functionality that allows developers to write Internet ping applications on Windows systems without Winsock 2 support.
Note that the Winsock 1.1 WSAStartup function must be called prior to using the functions exposed by ICMP.DLL. If you do not do this, the first call to IcmpSendEcho will fail with error 10091 (WSASYSNOTREADY).Below you can find the Ping unit's source code. Here are two example's of usage.
1) Example 1 (code snippet):
uses Ping;...const ADP_IP = '208.185.127.40'; begin If Ping.Ping(ADP_IP) then ShowMessage('About Delphi Programming reachable!');end; |
2) Here's another, Delphi program, that uses the Ping unit .. .
And, the Ping unit's source: