示例#1
0
        private void StartTest(TestStatus test)
        {
            ProcessStatus ps = test as ProcessStatus;

            if (ps != null)
            {
                StartProcess(ps, true);
                return;
            }
            DnsResolveStatus rs = test as DnsResolveStatus;

            if (rs != null)
            {
                StartDnsResolve(rs);
                return;
            }
            MultiProcessStatus mps = test as MultiProcessStatus;

            if (mps != null)
            {
                StartMultiPorcess(mps);
                return;
            }
            Debug.Assert(false);
        }
示例#2
0
 public void DnsTestFinishedThreadSafe(DnsResolveStatus rs)
 {
     if (this.InvokeRequired)
     {
         var myDelegate = new DnsTestFinishedDelegate(DnsTestFinishedThreadSafe);
         this.BeginInvoke(myDelegate, new object[] { rs });
         return;
     }
     rs.Stop();
     NotifyUiTestFinished();
 }
示例#3
0
        private void DnsCallback(IAsyncResult result)
        {
            DnsResolveStatus rs = result.AsyncState as DnsResolveStatus;

            try
            {
                IPAddress[] ips = Dns.EndGetHostAddresses(result);
                rs.IPAddresses = ips;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.ToString());
            }
            DnsTestFinishedThreadSafe(rs);
        }
示例#4
0
 public void DnsTestFinishedThreadSafe(DnsResolveStatus rs)
 {
     if (this.InvokeRequired)
     {
         var myDelegate = new DnsTestFinishedDelegate(DnsTestFinishedThreadSafe);
         this.BeginInvoke(myDelegate, new object[] { rs });
         return;
     }
     rs.Stop();
     NotifyUiTestFinished();
 }
示例#5
0
 private void StartDnsResolve(DnsResolveStatus rs)
 {
     Dns.BeginGetHostAddresses(rs.Hostname, new AsyncCallback(DnsCallback), rs);
 }
示例#6
0
 private void StartDnsResolve(DnsResolveStatus rs)
 {
     Dns.BeginGetHostAddresses(rs.Hostname, new AsyncCallback(DnsCallback), rs);
 }