SocketTools .NET Edition

IcmpClient.TraceRoute Method (String)

Send a series of echo datagrams to trace the route taken from the local system to the remote host

[Visual Basic]
Overloads Public Function TraceRoute( _
   ByVal hostName As String _
) As Integer
[C#]
public int TraceRoute(
   string hostName
);

Parameters

hostName
A string which specifies the host name or IP address which the echo datagram will be sent to.

Return Value

The method returns the total number of hops from the local system to the remote host. If the method fails, it will return a value of -1.

Remarks

The TraceRoute method sends a series of echo datagrams to the specified host, adjusting the time-to-live value to determine the intermediate hosts that route the packet. This method will always block the current thread until the trace completes.

The OnTrace event will fire for each intermediate host along the route.

The Timeout property specifies the timeout period in milliseconds.

See Also