Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
		static Dns ()
		{
#if !MOBILE
			if (Environment.GetEnvironmentVariable ("MONO_DNS") != null) {
				resolver = new SimpleResolver ();
				use_mono_dns = true;
			}
#endif
		}
Ejemplo n.º 3
0
Archivo: Dns.cs Proyecto: 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
		}
Ejemplo n.º 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);
		}