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>();
        }
Beispiel #2
0
        public EventChannel() : base("EventChannel")
        {
            ChannelParameters eventChannelParameters = CreateEventChannelParam(true);

            messageChannel = new Channel(eventChannelParameters);
            messageChannel.SendEvent(CreateChannelEvent());
        }
Beispiel #3
0
        private ChannelParameters CreateEventChannelParam(bool ToStore)
        {
            ChannelParameters parameters = new ChannelParameters()
            {
                ChannelName = this.ChannelName,
                ClientID    = "EventChannelID",
                Store       = ToStore,
                Logger      = this.logger
            };

            return(parameters);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
 public MemoryChannel(byte id, ChannelParameters parameters, Settings settings)
 {
     this.Id          = id;
     this.Direction   = parameters.Direction;
     this.Reliability = parameters.Reliability;
 }
Beispiel #8
0
 public override IMessageChannel <Message> GetMessageChannel <Message>(byte id, ChannelParameters parameters)
 {
     ref var channel = ref this.channels[id];
Beispiel #9
0
 private void SendCommandRequest()
 {
     requestChannelParameters = CreateRequestChannelParam(RequestType.Command);
     requestChannel           = new Channel(requestChannelParameters);
     requestChannel.SendRequest(CreateChannelRequest());
 }
Beispiel #10
0
 private void SendQueryRequest()
 {
     requestChannelParameters = CreateRequestChannelParam(RequestType.Query);
     requestChannel           = new Channel(requestChannelParameters);
     Response request = requestChannel.SendRequest(CreateChannelRequest());
 }