示例#1
0
        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);
        }
示例#2
0
文件: Dns.cs 项目: ItsVeryWindy/mono
		static Dns ()
		{
#if !MOBILE
			if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) {
				resolver = new SimpleResolver ();
				use_mono_dns = true;
			}
#endif
		}
示例#3
0
文件: Dns.cs 项目: shana/mono
		static Dns ()
		{
			System.Net.Sockets.Socket.CheckProtocolSupport();

#if !MOBILE
			if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) {
				resolver = new SimpleResolver ();
				use_mono_dns = true;
			}
#endif
		}
示例#4
0
		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);
		}