Home | Contact Us | Download | Support | Purchase | Products


Product List
 
  "Thanks a lot for the great responsive service !"
Alexis
ixpertise
 
More
Testimonies

TraceRoute Asychronously

The following example demonstrates how to perform a TraceRoute asynchronously.

[C#]

 using System;
 using aspNetTraceRoute;
 namespace ConsoleApplication1
 {
 	class Class1
 	{
 		static void Main(string[] args)
 		{
 			TraceRouteClient client = new TraceRouteClient();
 			client.BeginTraceRoute( "www.yahoo.com", 30, true, new AsyncCallback( MyCallback ), client );
 
 			Console.WriteLine( "done.");
 			Console.ReadLine();
 			
 		}
 
 		static void MyCallback( IAsyncResult iar )
 		{
 			try
 			{
 				TraceRouteClient client = (TraceRouteClient)iar.AsyncState;
 				TraceRouteReplyCollection results = client.EndTraceRoute( iar );
 				Console.WriteLine( results.ToString() );
 			}
 			catch(Exception ex )
 			{
 				Console.WriteLine( ex.ToString() );
 			}
 
 		}
 	}
 }


[VB.NET]

 Imports System
 Imports aspNetTraceRoute
 Module Module1
 
     Sub Main()
         Dim client As New TraceRouteClient()
         client.BeginTraceRoute("www.yahoo.com", 30, True, AddressOf MyCallback, client)
 
         Console.WriteLine("done.")
         Console.ReadLine()
     End Sub
 
     Sub MyCallback(ByVal iar As IAsyncResult)
         Try
             Dim client As TraceRouteClient = CType(iar.AsyncState, TraceRouteClient)
             Dim results As TraceRouteReplyCollection = client.EndTraceRoute(iar)
             Console.WriteLine(results.ToString())
         Catch ex As Exception
             Console.WriteLine(ex.ToString())
         End Try
     End Sub 'MyCallback 
 
 
 
 End Module











 

 

 

 



The box is not shipped. aspNetTraceRoute is a downloadable product.