public SolaceChannelListener(SolaceTransportBindingElement bindingElement, BindingContext context)
            : base(context.Binding)
        {
            // populate members from binding element
            int maxBufferSize = (int)bindingElement.MaxReceivedMessageSize;

            bufferManager = BufferManager.CreateBufferManager(bindingElement.MaxBufferPoolSize, maxBufferSize);
            enpointCache  = bindingElement.EndpointCache;

            converters = context.BindingParameters.FindAll <IMessageConverter>();

            var messageEncoderBindingElements
                = context.BindingParameters.FindAll <MessageEncodingBindingElement>();

            if (messageEncoderBindingElements.Count > 1)
            {
                throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
            }
            else if (messageEncoderBindingElements.Count == 1)
            {
                if (!(messageEncoderBindingElements[0] is ByteStreamMessageEncodingBindingElement))
                {
                    throw new InvalidOperationException("This transport must be used with the ByteStreamMessageEncodingBindingElement.");
                }

                encoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory();
            }
            else
            {
                encoderFactory = new ByteStreamMessageEncodingBindingElement().CreateMessageEncoderFactory();
            }

            uri = new Uri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
        }
 public SolaceTransportBindingElement(SolaceTransportBindingElement other)
     : base(other)
 {
     VPN           = other.VPN;
     UserName      = other.UserName;
     Password      = other.Password;
     SessionEvent += other.SessionEvent;
     cache         = other.cache;
 }