예제 #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);
 }
예제 #2
0
파일: whore.cs 프로젝트: b1tninja/whore
        //<summary> Takes a task from the queue and has a TorInstance handle it.
        //</summary>
        public void doWork()
        {
            if (taskList.Count > 0)
            {
                System.Console.WriteLine("Going to dequeue a task.");
                Task task = taskList.Dequeue();
                if (task is TorTask)
                {
                    TorTask                torTask = (TorTask)task;
                    TorInstance            torInstance = getAvailableTorInstance();
                    Task.TaskResultHandler a, b, c;
                    a = displayResults;
                    if (torTask.getOwner() != null)
                    {
                        Console.WriteLine("Adding Managed Task");
                        a = torTask.getOwner().notify;
                    }
                    b = db.cache;
                    c = a + b;
                    torTask.execute(torInstance, c);
                }
            }
            else
            {
//                Console.WriteLine("No work to be done.");
                Thread.Sleep(50);
            }
        }
예제 #3
0
파일: whois.cs 프로젝트: Betawolf/whore
 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);
 }
예제 #4
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);
        }
예제 #5
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);
            }
        }
예제 #6
0
파일: tor.cs 프로젝트: Betawolf/whore
        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);
        }