Inheritance: ListenerBase
示例#1
0
 public void FixtureSetup()
 {
     _listener = new HttpListener(_uri.OriginalString);
     _listener.Start();
     _server = new Tracker();
     _server.RegisterListener(_listener);
     _listener.Start();
 }
示例#2
0
        public void FixtureSetup()
        {
            _keys = new List<string>();
            _server = new OctoTorrent.Tracker.Tracker {AllowUnregisteredTorrents = true};
            _listener = new HttpListener(Prefix);
            _listener.AnnounceReceived += (o, e) => _keys.Add(e.Key);
            _server.RegisterListener(_listener);

            _listener.Start();
        }
示例#3
0
        ///<summary>Start the Tracker. Start Watching the TORRENT_DIR Directory for new Torrents.</summary>
        public MySimpleTracker()
        {
            var listenpoint = new System.Net.IPEndPoint(System.Net.IPAddress.Loopback, 10000);
            Console.WriteLine("Listening at: {0}", listenpoint);

            var listener = new HttpListener(listenpoint);

            _tracker = new Tracker {AllowUnregisteredTorrents = true};
            _tracker.RegisterListener(listener);
            listener.Start();

            SetupTorrentWatcher();

            while (true)
                Thread.Sleep(10000);
        }