SocketTools .NET Edition

Internet Control Message Protocol

The Internet Control Message Protocol (ICMP) class enables your application to send and receive ICMP echo datagrams. These are a special type of IP datagram which can be used to determine if a remote host is reachable, as well as determine the amount of time it takes for data to be exchanged with the local system. The ICMP class can also be used to trace the route that data takes from the local system to the remote host, which can be useful in determining why a connection to a particular system may be experiencing higher latency than normal.

Overview

Initialize
Initialize an instance of the class, loading the networking library and validating the development license. This method must be called before any properties are changed or any other methods in this class are called by the application.

Reset
Reset the internal state of the component. This can be useful if your application wishes to discard any settings made by a user and return that instance of the class to its default state.

Uninitialize
Unload the networking library and release any resources that have been allocated for the current process. This is the last method call that the application should make prior to terminating. This is only necessary if the application has previously called the Initialize method.

Ping and TraceRoute

To determine if a remote host is reachable, your application can send ICMP echo datagrams. You can also map the route between the local system and the remote host by sending a series of echo datagrams to each intermediate host. This is what the ping.exe and tracert.exe command line utilities do, and you can emulate that functionality in your own applications.

Echo
This is the simplest method you can use to send ICMP echo datagrams. Specify the remote host, the size of the ICMP datagram you want to send and the number of times you want to send it. The method will return if the operation was successful along with information such as the average number of milliseconds it took for the datagram to be returned by the remote host.

TraceRoute
This method will map the route that data packets take from your local system to a remote host. Whenever you send data over the Internet, that data is routed from one computer system to another until it reaches its destination. This method returns statistical information about each system that the data is routed through, and the latency between that system and the local host. For each intermediate host in the route to the destination server, the OnTrace event will fire.

OnTrace
This event is generated when the TraceRoute method is called. The event will fire for each intermediate host in the route from the local system and the remote host.