public void Setup()
 {
     id.BitField.SetAll(true);
     tester = new TestPicker();
     picker = new PriorityPicker(tester);
     picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List<Piece>());
     foreach (TorrentFile file in rig.Torrent.Files)
         file.Priority = Priority.Normal;
 }
 public void Setup()
 {
     id.BitField.SetAll(true);
     tester = new TestPicker();
     picker = new PriorityPicker(tester);
     picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>());
     foreach (TorrentFile file in rig.Torrent.Files)
     {
         file.Priority = Priority.Normal;
     }
 }
Beispiel #3
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);
        }
 public void Setup()
 {
     rig = TestRig.CreateMultiFile();
     id  = new PeerId(new Peer(new string('a', 20), new Uri("tcp://BLAH")), rig.Manager);
     id.BitField.SetAll(true);
     tester = new TestPicker();
     picker = new PriorityPicker(tester);
     picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>());
     foreach (TorrentFile file in rig.Torrent.Files)
     {
         file.Priority = Priority.Normal;
     }
 }
        public void Setup()
        {
            tester = new TestPicker();
            rarest = new RarestFirstPicker(tester);
            rarest.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List<Piece>());
            peers = new List<PeerId>();
            for (int i = 0; i < 5; i++)
                peers.Add(new PeerId(new Peer(new string((char)(i + 'a'), 20), new Uri("tcp://aaa")), rig.Manager));

            for (int i = 0; i < rig.Manager.Bitfield.Length; i++)
            {
                for (int j = 0; j < peers.Count; j++)
                    peers[j].BitField[i] = i % (j + 1) == 0;
            }
            peers[0].BitField.SetAll(true);
        }
        public void Setup()
        {
            tester = new TestPicker();
            rarest = new RarestFirstPicker(tester);
            rarest.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List <Piece>());
            peers = new List <PeerId>();
            for (int i = 0; i < 5; i++)
            {
                peers.Add(new PeerId(new Peer(new string((char)(i + 'a'), 20), new Uri("tcp://aaa")), rig.Manager));
            }

            for (int i = 0; i < rig.Manager.Bitfield.Length; i++)
            {
                for (int j = 0; j < peers.Count; j++)
                {
                    peers[j].BitField[i] = i % (j + 1) == 0;
                }
            }
            peers[0].BitField.SetAll(true);
        }
Beispiel #7
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }