static void Main(string [] args) { if (args.Length == 0) { return; } counter = args.Length; Stopwatch watch = new Stopwatch(); watch.Start(); SimpleResolver r = new SimpleResolver(); foreach (string s in args) { SimpleResolverEventArgs e = new SimpleResolverEventArgs(); e.Completed += OnCompleted; e.HostName = s; if (!r.GetHostEntryAsync(e)) { OnCompleted(e, e); } } exit_event.WaitOne(); watch.Stop(); Console.WriteLine(watch.Elapsed); }
static Dns () { #if !MOBILE if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) { resolver = new SimpleResolver (); use_mono_dns = true; } #endif }
static Dns () { System.Net.Sockets.Socket.CheckProtocolSupport(); #if !MOBILE if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) { resolver = new SimpleResolver (); use_mono_dns = true; } #endif }
static void Main (string [] args) { if (args.Length == 0) return; counter = args.Length; Stopwatch watch = new Stopwatch (); watch.Start (); SimpleResolver r = new SimpleResolver (); foreach (string s in args) { SimpleResolverEventArgs e = new SimpleResolverEventArgs (); e.Completed += OnCompleted; e.HostName = s; if (!r.GetHostEntryAsync (e)) OnCompleted (e, e); } exit_event.WaitOne (); watch.Stop (); Console.WriteLine (watch.Elapsed); }