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); }
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); }
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); }
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); }