Example #1
0
        void AddReceiverBinding()
        {
            if (_receiver != null)
            {
                return;
            }

            _receiver = new PerConnectionReceiver(_address, _receiverSettings,
                                                  recv =>
            {
                lock (_subscribed)
                    foreach (var d in _subscribed)
                    {
                        recv.Subscribe(d.Item1, d.Item2);
                    }
            },
                                                  recv =>
            {
                lock (_subscribed)
                    foreach (var d in _subscribed)
                    {
                        recv.Unsubscribe(d.Item1);
                    }
            });

            _connectionHandler.AddBinding(_receiver);
        }
Example #2
0
        void RemoveReceiverBinding()
        {
            if (_receiver == null)
            {
                return;
            }

            _connectionHandler.RemoveBinding(_receiver);
            _receiver = null;
        }