Exemplo n.º 1
0
        internal PiecePicker CreateStandardPicker()
        {
            PiecePicker picker;

            if (ClientEngine.SupportsEndgameMode)
            {
                picker = new EndGameSwitcher(new StandardPicker(), new EndGamePicker(),
                                             Torrent.PieceLength / Piece.BlockSize, this);
            }
            else
            {
                picker = new StandardPicker();
            }
            picker = new RandomisedPicker(picker);
            picker = new RarestFirstPicker(picker);
            picker = new PriorityPicker(picker);
            return(picker);
        }
Exemplo n.º 2
0
        private PiecePicker CreateSlidingPicker(TorrentManager torrent)
        {
            PiecePicker picker;

            if (ClientEngine.SupportsEndgameMode)
            {
                picker = new EndGameSwitcher(new StandardPicker(), new EndGamePicker(), torrent.Torrent.PieceLength / Piece.BlockSize, torrent);
            }
            else
            {
                picker = new StandardPicker();
            }
            picker = new RandomisedPicker(picker);
            picker = new SlidingWindowPicker(picker);
            picker = new PriorityPicker(picker);

            return(picker);
        }
Exemplo n.º 3
0
        public PeriodicTorrent(TorrentWrapper wrapper)
        {
            TorrentInfo = new TorrentInfo();
            Torrent     = wrapper;
            PeerList    = new ObservableCollection <PeerId>();

            Name             = Torrent.Name;
            Size             = Torrent.Size;
            CompletedOnAdd   = Torrent.Complete;
            CompletionTime   = DateTime.MinValue;
            NotifiedComplete = false;
            PiecePicker      = new RandomisedPicker(new StandardPicker());
            wrapper.PieceManager.BlockReceived += PieceManager_BlockReceived;
            wrapper.PieceHashed += wrapper_PieceHashed;
            TorrentInfo.Path     = Torrent.Path;
            PausedFromSeeding    = false;
            StoppedByUser        = false;
            ExcludeFromQueue     = false;
            Update(false);
        }
Exemplo n.º 4
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }