public RandomisedPickerTests()
        {
            rig = TestRig.CreateMultiFile();
            id = new PeerId(new Peer(new string('a', 20), new Uri("tcp://BLAH")), rig.Manager);
            for (var i = 0; i < id.BitField.Length; i += 2)
                id.BitField[i] = true;

            tester = new TestPicker();
            picker = new RandomisedPicker(tester);
        }
示例#2
0
        public void Setup()
        {
            rig = TestRig.CreateMultiFile();
            id  = new PeerId(new Peer(new string('a', 20), new Uri("tcp://BLAH")), rig.Manager);
            for (int i = 0; i < id.BitField.Length; i += 2)
            {
                id.BitField[i] = true;
            }

            tester = new TestPicker();
            picker = new RandomisedPicker(tester);
        }
示例#3
0
 public PeriodicTorrent(TorrentWrapper wrapper)
 {
     Torrent = wrapper;
     PeerList = new ObservableCollection<PeerId>();
     Update();
     Name = Torrent.Name;
     Size = Torrent.Size;
     CompletedOnAdd = Torrent.Complete;
     NotifiedComplete = false;
     PiecePicker = new RandomisedPicker(new StandardPicker());
     wrapper.PieceManager.BlockReceived += PieceManager_BlockReceived;
     wrapper.PieceHashed += wrapper_PieceHashed;
 }
        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);
        }
 public PeriodicTorrent(TorrentWrapper wrapper)
 {
     TorrentInfo = new TorrentInfo();
     Torrent = wrapper;
     PeerList = new ObservableCollection<PeerId>();
     Update();
     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;
 }
示例#6
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }