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); } }
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); } }
protected virtual void HandleHaveAllMessage(PeerId id, HaveAllMessage message) { id.BitField.SetAll(true); id.Peer.IsSeeder = true; SetAmInterestedStatus(id, manager.PieceManager.IsInteresting(id)); }
void peer_HaveAllMessageReceived(object sender, HaveAllMessage e) { ShowMessage("{0}:Received {1}", sender, e); }
protected override void HandleHaveAllMessage(PeerId id, HaveAllMessage message) { // Nothing }
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); }