예제 #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
파일: resolver.cs 프로젝트: netngn/Mono.Dns
		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);
		}