3 using System.Diagnostics;
7 static int frame_count = 0;
8 public static int Main(string[] args)
10 AsyncCallback cback = new AsyncCallback(ResolveCallback);
11 IAsyncResult res = Dns.BeginGetHostEntry("localhost", cback, null);
12 for (int i = 0; i < 100; ++i) {
15 System.Threading.Thread.Sleep(100);
19 while (!res.IsCompleted) {
20 System.Threading.Thread.Sleep(20);
22 IPHostEntry ip = Dns.EndGetHostEntry (res);
23 Console.WriteLine (ip);*/
28 AppDomain.CreateDomain("1").CreateInstance(typeof (Class1).Assembly.GetName ().Name, "Class1");
33 public static void ResolveCallback(IAsyncResult ar)
35 Console.WriteLine("ResolveCallback()");
36 StackTrace st = new StackTrace();
37 frame_count = st.FrameCount;
38 for(int i = 0; i < st.FrameCount; i++) {
39 StackFrame sf = st.GetFrame(i);
40 Console.WriteLine("method: {0}", sf.GetMethod());
42 Console.WriteLine("ResolveCallback() complete");
49 AppDomain.CreateDomain("2").CreateInstance(typeof (Class1).Assembly.GetName ().Name, "Class2");