示例#1
0
        public static void SendChoke(this CoordinatorHooks hooks, PeerHash peer, bool value)
        {
            string        type    = value ? "choke" : "unchoke";
            SenderMessage message = new CoordinatorGenericMessage(type);

            hooks.CallMessageRequested(peer, message);
        }
示例#2
0
 public static void SendExtended(this CoordinatorHooks hooks, PeerHash peer, Extended extended)
 {
     hooks.CallMessageRequested(peer, new CoordinatorExtendedMessage(extended));
 }
示例#3
0
 public static void SendPiece(this CoordinatorHooks hooks, PeerHash peer, Piece piece)
 {
     hooks.CallMessageRequested(peer, new CoordinatorPieceMessage(piece));
 }
示例#4
0
 public static void SendRequest(this CoordinatorHooks hooks, PeerHash peer, Request request)
 {
     hooks.CallMessageRequested(peer, new CoordinatorRequestMessage(request));
 }
示例#5
0
 public static void SendBitfield(this CoordinatorHooks hooks, PeerHash peer, Bitfield bitfield)
 {
     hooks.CallMessageRequested(peer, new CoordinatorBitfieldMessage(bitfield));
 }
示例#6
0
 public static void SendInterested(this CoordinatorHooks hooks, PeerHash peer)
 {
     hooks.CallMessageRequested(peer, new CoordinatorGenericMessage("interested"));
 }