public override void Tick(int counter)
 {
     base.Tick(counter);
     if (unchoker.Complete)
     {
         PeerMessage bitfieldMessage = new BitfieldMessage(Manager.Bitfield);
         PeerMessage haveAllMessage  = new HaveAllMessage();
         foreach (PeerId peer in Manager.Peers.ConnectedPeers)
         {
             PeerMessage message = ClientEngine.SupportsFastPeer && peer.SupportsFastPeer && Manager.Complete ? haveAllMessage : bitfieldMessage;
             peer.MessageQueue.Enqueue(message);
         }
         Manager.Mode = new DownloadMode(Manager, DiskManager, ConnectionManager, Settings);
     }
 }
示例#2
0
 public override void Tick(int counter)
 {
     base.Tick(counter);
     if (unchoker.Complete)
     {
         PeerMessage bitfieldMessage = new BitfieldMessage(Manager.Bitfield);
         PeerMessage haveAllMessage  = new HaveAllMessage();
         foreach (var peer in Manager.Peers.ConnectedPeers)
         {
             PeerMessage message = peer.SupportsFastPeer && Manager.Complete ? haveAllMessage : bitfieldMessage;
             peer.Enqueue(message);
         }
         Manager.Mode = new DownloadMode(Manager);
     }
 }
示例#3
0
 protected virtual void HandleHaveAllMessage(PeerId id, HaveAllMessage message)
 {
     id.BitField.SetAll(true);
     id.Peer.IsSeeder = true;
     SetAmInterestedStatus(id, manager.PieceManager.IsInteresting(id));
 }
示例#4
0
 void peer_HaveAllMessageReceived(object sender, HaveAllMessage e)
 {
     ShowMessage("{0}:Received {1}", sender, e);
 }
示例#5
0
 protected override void HandleHaveAllMessage(PeerId id, HaveAllMessage message)
 {
     // Nothing
 }
示例#6
0
 protected virtual void HandleHaveAllMessage(PeerId id, HaveAllMessage message)
 {
     id.BitField.SetAll(true);
     id.Peer.IsSeeder = true;
     SetAmInterestedStatus(id, _manager.PieceManager.IsInteresting(id));
 }
        public override void Tick(int counter)
        {
            base.Tick(counter);
            if (!_unchoker.Complete)
                return;

            PeerMessage bitfieldMessage = new BitfieldMessage(Manager.Bitfield);
            PeerMessage haveAllMessage = new HaveAllMessage();
            foreach (var peer in Manager.Peers.ConnectedPeers)
            {
                var message = peer.SupportsFastPeer && Manager.Complete ? haveAllMessage : bitfieldMessage;
                peer.Enqueue(message);
            }
            Manager.Mode = new DownloadMode(Manager);
        }