Example #1
0
        void Unchoke(PeerId peer)
        {
            if (!peer.AmChoking)
            {
                throw new InvalidOperationException("Attempting to unchoke a peer who is already unchoked");
            }

            peer.AmChoking = false;
            Unchokeable.UploadingTo++;
            peer.EnqueueAt(new UnchokeMessage(), 0);
            peer.LastUnchoked.Restart();
            peer.FirstReviewPeriod = true;
        }
Example #2
0
        void Choke(PeerId peer)
        {
            if (peer.AmChoking)
            {
                throw new InvalidOperationException("Attempting to choke a peer who is already choked");
            }

            peer.AmChoking = true;
            Unchokeable.UploadingTo--;
            peer.EnqueueAt(new ChokeMessage(), 0);
            RejectPendingRequests(peer);
            peer.LastUnchoked = new ValueStopwatch();
        }
        public void Choke(PeerId peer)
        {
            //Choke the supplied peer

            if (peer.AmChoking)
                //We're already choking this peer, nothing to do
                return;

            peer.AmChoking = true;
            owningTorrent.UploadingTo--;
            RejectPendingRequests(peer);
            peer.EnqueueAt(new ChokeMessage(), 0);
            Logger.Log(peer.Connection, "Choking");
            //			Send2Log("Choking: " + PeerToChoke.Location);
        }
Example #4
0
        public void Choke(PeerId peer)
        {
            //Choke the supplied peer

            if (peer.AmChoking)
            {
                //We're already choking this peer, nothing to do
                return;
            }

            peer.AmChoking = true;
            owningTorrent.UploadingTo--;
            RejectPendingRequests(peer);
            peer.EnqueueAt(new ChokeMessage(), 0);
            Logger.Log(peer.Connection, "Choking");
            //			Send2Log("Choking: " + PeerToChoke.Location);
        }
Example #5
0
        public void Unchoke(PeerId PeerToUnchoke)
        {
            //Unchoke the supplied peer

            if (!PeerToUnchoke.AmChoking)
            {
                //We're already unchoking this peer, nothing to do
                return;
            }

            PeerToUnchoke.AmChoking = false;
            owningTorrent.UploadingTo++;
            PeerToUnchoke.EnqueueAt(new UnchokeMessage(), 0);
            PeerToUnchoke.LastUnchoked      = DateTime.Now;
            PeerToUnchoke.FirstReviewPeriod = true;
            Logger.Log(PeerToUnchoke.Connection, "Unchoking");
            //			Send2Log("Unchoking: " + PeerToUnchoke.Location);
        }
        private void Unchoke(PeerId PeerToUnchoke)
        {
            //Unchoke the supplied peer

            if (!PeerToUnchoke.AmChoking)
                //We're already unchoking this peer, nothing to do
                return;

            PeerToUnchoke.AmChoking = false;
            owningTorrent.UploadingTo++;
            PeerToUnchoke.EnqueueAt(new UnchokeMessage(), 0);
            PeerToUnchoke.LastUnchoked = DateTime.Now;
            PeerToUnchoke.FirstReviewPeriod = true;
            Logger.Log(PeerToUnchoke.Connection, "Unchoking");
            //			Send2Log("Unchoking: " + PeerToUnchoke.Location);
        }