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); }
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); }
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); } }
public virtual void execute(TaskResultHandler callback) { this.callback = callback; System.Console.WriteLine("Executing task {0}.", this.GetHashCode()); }
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); }