Exemple #1
0
 protected override void HandleInterested(InterestedMessage interested, PeerState peer)
 {
     base.HandleInterested(interested, peer);
     peer.IsChoked = false;
     SendMessage(peer, new UnchokeMessage());
 }
Exemple #2
0
 protected override void HandlePiece(PieceMessage piece, PeerState peer)
 {
 }
Exemple #3
0
 protected override void HandleRequest(RequestMessage request, PeerState peer)
 {
 }
Exemple #4
0
 private void SendBitfield(PeerState peer)
 {
     SendMessage(peer, new BitfieldMessage(BlockStrategist.Bitfield));
 }
Exemple #5
0
 protected virtual bool AddPeer(PeerState peer)
 {
     return(Peers.TryAdd(peer.ID, peer));
 }
Exemple #6
0
 protected override void HandleUnchoke(UnchokeMessage unchoke, PeerState peer)
 {
     base.HandleUnchoke(unchoke, peer);
     SendBlockRequests(peer);
 }
Exemple #7
0
 protected virtual void HandleNotInterested(NotInterestedMessage notInterested, PeerState peer)
 {
     peer.IsInterested = false;
 }
Exemple #8
0
 protected virtual void HandleBitfield(BitfieldMessage bitfield, PeerState peer)
 {
     bitfield.Bitfield.CopyTo(peer.Bitfield, 0, 0, Metadata.PieceCount);
 }
Exemple #9
0
 protected virtual void HandleInterested(InterestedMessage interested, PeerState peer)
 {
     peer.IsInterested = true;
 }
Exemple #10
0
 protected virtual void HandleUnchoke(UnchokeMessage unchoke, PeerState peer)
 {
     peer.AmChoked = false;
 }
Exemple #11
0
 protected virtual void HandleChoke(ChokeMessage choke, PeerState peer)
 {
     peer.AmChoked = true;
 }
Exemple #12
0
 protected abstract void HandlePiece(PieceMessage piece, PeerState peer);
Exemple #13
0
 protected abstract void HandleRequest(RequestMessage request, PeerState peer);