public MemoryMessageChannel(byte id, ChannelParameters parameters, Settings settings) : base(id, parameters, settings) { this.maxQueue = parameters.MaxQueueSize > 0 ? parameters.MaxQueueSize : 1024; this.sendBuffer = new ArrayReadWriteBuffer <Message>(); this.receiveBuffer = new ArrayReadWriteBuffer <Message>(); }
public EventChannel() : base("EventChannel") { ChannelParameters eventChannelParameters = CreateEventChannelParam(true); messageChannel = new Channel(eventChannelParameters); messageChannel.SendEvent(CreateChannelEvent()); }
private ChannelParameters CreateEventChannelParam(bool ToStore) { ChannelParameters parameters = new ChannelParameters() { ChannelName = this.ChannelName, ClientID = "EventChannelID", Store = ToStore, Logger = this.logger }; return(parameters); }
private ChannelParameters CreateRequestChannelParam(RequestType requestType) { ChannelParameters channelParameters = new ChannelParameters() { ChannelName = this.ChannelName, ClientID = this.ClientID, Timeout = this.Timeout, CacheKey = "", CacheTTL = 0, Logger = logger, RequestsType = requestType }; return(channelParameters); }
private ChannelParameters GetChannelParam() { ChannelParameters requestChannel = new ChannelParameters { ChannelName = KubeMQChannel, ClientID = $"Client:{KubeMQChannel}", KubeMQAddress = KubeMQ, Logger = _logger, Timeout = GetKubeMQTimeOut(), CacheKey = "", CacheTTL = 0, RequestsType = RequestType.Query }; return(requestChannel); }
private LocalChannel CreateChannel(uint index, FundingTransaction fundingTx, OpenChannelMessage openMessage, AcceptChannelMessage acceptMessage) { LocalChannel channel = new LocalChannel(); channel.ChannelIndex = index; channel.TemporaryChannelId = openMessage.TemporaryChannelId.ToHex(); channel.LocalChannelParameters = ChannelParameters.CreateFromOpenMessage(openMessage); channel.RemoteChannelParameters = ChannelParameters.CreateFromAcceptMessage(acceptMessage); channel.FundingSatoshis = openMessage.FundingSatoshis; channel.PushMSat = openMessage.PushMSat; channel.MinimumDepth = acceptMessage.MinimumDepth; channel.FundingTransactionId = fundingTx.Transaction.GetHash().ToString(); channel.FundingOutputIndex = fundingTx.FundingOutputIndex; channel.ChannelId = LocalChannel.DeriveChannelId(fundingTx.Transaction, fundingTx.FundingOutputIndex); channel.FeeRatePerKw = openMessage.FeeratePerKw; return(channel); }
public MemoryChannel(byte id, ChannelParameters parameters, Settings settings) { this.Id = id; this.Direction = parameters.Direction; this.Reliability = parameters.Reliability; }
public override IMessageChannel <Message> GetMessageChannel <Message>(byte id, ChannelParameters parameters) { ref var channel = ref this.channels[id];
private void SendCommandRequest() { requestChannelParameters = CreateRequestChannelParam(RequestType.Command); requestChannel = new Channel(requestChannelParameters); requestChannel.SendRequest(CreateChannelRequest()); }
private void SendQueryRequest() { requestChannelParameters = CreateRequestChannelParam(RequestType.Query); requestChannel = new Channel(requestChannelParameters); Response request = requestChannel.SendRequest(CreateChannelRequest()); }