Exemple #1
0
 public override void execute(TorInstance torInstance, TaskResultHandler callback)
 {
     base.execute(torInstance, callback);
     // doesn't seem like the appropriate level to be spawning tasks... for instance, how to interface db?
     // spwans a DnsTask to resolve the CNAME that tells us where to connect to perform the whois.
     new DnsTask(new DnsTransaction.QuestionRecord(string.Format("{0}.whois-servers.net", getTLD()), DnsTransaction.QTYPE.CNAME, DnsTransaction.RCLASS.IN)).execute(torInstance, callback);
 }
Exemple #2
0
 public override void execute(TorInstance torInstance, TaskResultHandler callback)
 {
     base.execute(torInstance, callback);
     // doesn't seem like the appropriate level to be spawning tasks... for instance, how to interface db?
     // spwans a DnsTask to resolve the CNAME that tells us where to connect to perform the whois.
     new DnsTask(new DnsTransaction.QuestionRecord(string.Format("{0}.whois-servers.net", getTLD()), DnsTransaction.QTYPE.CNAME, DnsTransaction.RCLASS.IN)).execute(torInstance, callback);
 }
Exemple #3
0
        public override void execute(TorInstance torInstance, TaskResultHandler callback)
        {
            base.execute(torInstance, callback);

            // TODO: Look up proper nameserver to use, from cache (or by resolving NS)

            endPoint = new DnsEndPoint("8.8.8.8", 53);
            torInstance.proxy.CreateConnectionAsyncCompleted += new EventHandler <CreateConnectionAsyncCompletedEventArgs>(onConnect);
            torInstance.proxy.CreateConnectionAsync(endPoint.Host, endPoint.Port);
        }
Exemple #4
0
        public virtual void execute(TorInstance _tor, TaskResultHandler callback)
        {
            base.execute(callback);
            tor = _tor;
            while (tor == null)
            {
                Thread.Sleep(SLEEP_TIME);
            }

            tor.State = TorInstance.TorState.Busy;
            while (tor.State != TorInstance.TorState.Busy)
            {
                Thread.Sleep(SLEEP_TIME);
            }
        }
Exemple #5
0
 public virtual void execute(TaskResultHandler callback)
 {
     this.callback = callback;
     System.Console.WriteLine("Executing task {0}.", this.GetHashCode());
 }
Exemple #6
0
 public virtual void execute(TaskResultHandler callback)
 {
     this.callback = callback;
     System.Console.WriteLine("Executing task {0}.", this.GetHashCode());
 }
Exemple #7
0
        public virtual void execute(TorInstance _tor, TaskResultHandler callback)
        {
            base.execute(callback);
            tor = _tor;
            while(tor == null)
                Thread.Sleep(SLEEP_TIME);

            tor.State = TorInstance.TorState.Busy;
            while (tor.State != TorInstance.TorState.Busy)
                Thread.Sleep(SLEEP_TIME);
        }