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); }
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); }
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); }
public void Setup() { tester = new TestPicker(); picker = new RandomisedPicker(tester); }