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); }
public static void SendExtended(this CoordinatorHooks hooks, PeerHash peer, Extended extended) { hooks.CallMessageRequested(peer, new CoordinatorExtendedMessage(extended)); }
public static void SendPiece(this CoordinatorHooks hooks, PeerHash peer, Piece piece) { hooks.CallMessageRequested(peer, new CoordinatorPieceMessage(piece)); }
public static void SendRequest(this CoordinatorHooks hooks, PeerHash peer, Request request) { hooks.CallMessageRequested(peer, new CoordinatorRequestMessage(request)); }
public static void SendBitfield(this CoordinatorHooks hooks, PeerHash peer, Bitfield bitfield) { hooks.CallMessageRequested(peer, new CoordinatorBitfieldMessage(bitfield)); }
public static void SendInterested(this CoordinatorHooks hooks, PeerHash peer) { hooks.CallMessageRequested(peer, new CoordinatorGenericMessage("interested")); }