public void Start(TrackerGetHooks hooks) { lock (this) { if (pipeline == null) { pipeline = new LeakPipeline(); pipeline.Start(); } if (worker == null) { worker = new CompletionThread(); worker.Start(); } if (service == null) { service = new TrackerGetBuilder() .WithPipeline(pipeline) .WithWorker(worker) .Build(hooks); service.Start(); } } }
protected virtual void StartTrackerGet() { TrackerGetHooks hooks = new TrackerGetHooks { OnAnnounced = OnTrackerAnnounced }; TrackerGet = new TrackerGetBuilder() .WithPipeline(Pipeline) .WithWorker(Worker) .WithPeer(Localhost) .Build(hooks); TrackerGet.Start(); }