Exemplo n.º 1
0
        public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

            if (!this.CanBuildChannelFactory <TChannel>(context))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(
                          "TChannel", SR.GetString(SR.ChannelTypeNotSupported, typeof(TChannel)));
            }

            IChannelFactory <IOutputChannel> innerChannelFactory = context.Clone().BuildInnerChannelFactory <IOutputChannel>();

            if (this.clientChannelDemuxer == null)
            {
                this.clientChannelDemuxer = new InputChannelDemuxer(context);
            }
            else
            {
#pragma warning suppress 56506 // Microsoft, context.RemainingBindingElements will never be null
                context.RemainingBindingElements.Clear();
            }
            LocalAddressProvider localAddressProvider = context.BindingParameters.Remove <LocalAddressProvider>();
            return((IChannelFactory <TChannel>)(object)
                   new InternalDuplexChannelFactory(this, context, this.clientChannelDemuxer, innerChannelFactory, localAddressProvider));
        }
Exemplo n.º 2
0
        internal InternalDuplexChannelFactory(InternalDuplexBindingElement bindingElement, BindingContext context, InputChannelDemuxer channelDemuxer, IChannelFactory <IOutputChannel> innerChannelFactory, LocalAddressProvider localAddressProvider) : base(context.Binding, innerChannelFactory)
        {
            this.channelDemuxer      = channelDemuxer;
            this.innerChannelFactory = innerChannelFactory;
            ChannelDemuxerFilter filter = new ChannelDemuxerFilter(new MatchNoneMessageFilter(), -2147483648);

            this.innerChannelListener = this.channelDemuxer.BuildChannelListener <IInputChannel>(filter);
            this.localAddressProvider = localAddressProvider;
            this.providesCorrelation  = bindingElement.ProvidesCorrelation;
        }
Exemplo n.º 3
0
        public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }
            if (!this.CanBuildChannelFactory <TChannel>(context))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", System.ServiceModel.SR.GetString("ChannelTypeNotSupported", new object[] { typeof(TChannel) }));
            }
            IChannelFactory <IOutputChannel> innerChannelFactory = context.Clone().BuildInnerChannelFactory <IOutputChannel>();

            if (this.clientChannelDemuxer == null)
            {
                this.clientChannelDemuxer = new InputChannelDemuxer(context);
            }
            else
            {
                context.RemainingBindingElements.Clear();
            }
            LocalAddressProvider localAddressProvider = context.BindingParameters.Remove <LocalAddressProvider>();

            return((IChannelFactory <TChannel>) new InternalDuplexChannelFactory(this, context, this.clientChannelDemuxer, innerChannelFactory, localAddressProvider));
        }
Exemplo n.º 4
0
 private InternalDuplexBindingElement(InternalDuplexBindingElement elementToBeCloned) : base(elementToBeCloned)
 {
     this.clientChannelDemuxer = elementToBeCloned.ClientChannelDemuxer;
     this.providesCorrelation  = elementToBeCloned.ProvidesCorrelation;
 }