/// <summary> /// Setup the RPC and register for incoming messages. /// </summary> /// <param name="peerBean">The peer bean.</param> /// <param name="connectionBean">The connection bean.</param> /// <param name="register">Whether incoming messages should be registered.</param> public NeighborRpc(PeerBean peerBean, ConnectionBean connectionBean, bool register) : base(peerBean, connectionBean) { if (register) { Register(Rpc.Commands.Neighbor.GetNr()); } }
/// <summary> /// Constructor that is only called from this class or from test cases. /// </summary> /// <param name="peerBean">The peer bean.</param> /// <param name="connectionBean">The connection bean.</param> /// <param name="enable">Used for test cases, set to true in production.</param> /// <param name="register">Used for test cases, set to true in production.</param> /// <param name="wait">Used for test cases, set to false in production.</param> public PingRpc(PeerBean peerBean, ConnectionBean connectionBean, bool enable, bool register, bool wait) : base(peerBean, connectionBean) { _enable = enable; _wait = wait; if (register) { ConnectionBean.Dispatcher.RegisterIOHandler(peerBean.ServerPeerAddress.PeerId, peerBean.ServerPeerAddress.PeerId, this, Rpc.Commands.Ping.GetNr()); } }
/// <summary> /// Registers the storage RPC for PUT, COMPARE PUT, GET, ADD and REMOVE. /// </summary> /// <param name="peerBean"></param> /// <param name="connectionBean"></param> /// <param name="storageLayer"></param> public StorageRpc(PeerBean peerBean, ConnectionBean connectionBean, StorageLayer storageLayer) : base(peerBean, connectionBean) { Register( Rpc.Commands.Put.GetNr(), Rpc.Commands.Get.GetNr(), Rpc.Commands.Add.GetNr(), Rpc.Commands.Remove.GetNr(), Rpc.Commands.Digest.GetNr(), Rpc.Commands.DigestBloomfilter.GetNr(), Rpc.Commands.DigestAllBloomfilter.GetNr(), Rpc.Commands.PutMeta.GetNr(), Rpc.Commands.DigestMetaValues.GetNr(), Rpc.Commands.PutConfirm.GetNr(), Rpc.Commands.GetLatest.GetNr(), Rpc.Commands.GetLatestWithDigest.GetNr(), Rpc.Commands.ReplicaPut.GetNr()); _bloomfilterFactory = peerBean.BloomfilterFactory; _storageLayer = storageLayer; }
/// <summary> /// Creates a handler with a peer bean and a connection bean. /// </summary> /// <param name="peerBean">The peer bean.</param> /// <param name="connectionBean">The connection bean.</param> protected DispatchHandler(PeerBean peerBean, ConnectionBean connectionBean) { PeerBean = peerBean; ConnectionBean = connectionBean; }
public NeighborRpc(PeerBean peerBean, ConnectionBean connectionBean) : this(peerBean, connectionBean, true) { }
public BroadcastRpc(PeerBean peerBean, ConnectionBean connectionBean, IBroadcastHandler broadcastHandler) : base(peerBean, connectionBean) { Register(Rpc.Commands.Broadcast.GetNr()); BroadcastHandler = broadcastHandler; }
/// <summary> /// Creates a new handshake RPC with listeners. /// </summary> /// <param name="peerBean">The peer bean.</param> /// <param name="connectionBean">The connection bean.</param> public PingRpc(PeerBean peerBean, ConnectionBean connectionBean) : this(peerBean, connectionBean, true, true, false) { }
public DirectDataRpc(PeerBean peerBean, ConnectionBean connectionBean) : base(peerBean, connectionBean) { Register(Rpc.Commands.DirectData.GetNr()); }
/// <summary> /// Constructor that registers this RPC with the message handler. /// </summary> /// <param name="peerBean">The peer bean.</param> /// <param name="connectionBean">The connection bean.</param> public QuitRpc(PeerBean peerBean, ConnectionBean connectionBean) : base(peerBean, connectionBean) { Register(Rpc.Commands.Quit.GetNr()); }