EnqueueAt() private method

private EnqueueAt ( PeerMessage message, int index ) : void
message PeerMessage
index int
return void
コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }