예제 #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"));
 }