예제 #1
0
 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;
 }
예제 #2
0
 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;
     }
 }
예제 #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;
     }
 }
예제 #5
0
        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);
        }
예제 #7
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }
예제 #8
0
 public void Setup()
 {
     tester = new TestPicker();
     picker = new RandomisedPicker(tester);
 }