public ReliableOutputSessionChannelOverRequest(ChannelManagerBase factory, IReliableFactorySettings settings,
                                                IClientReliableChannelBinder binder, FaultHelper faultHelper,
                                                LateBoundChannelParameterCollection channelParameters)
     : base(factory, settings, binder, faultHelper, channelParameters)
 {
     this.binder = binder;
 }
        public ReliableRequestSessionChannel(
            ChannelManagerBase factory,
            IReliableFactorySettings settings,
            IClientReliableChannelBinder binder,
            FaultHelper faultHelper,
            LateBoundChannelParameterCollection channelParameters,
            UniqueId inputID)
            : base(factory, binder.RemoteAddress, binder.Via, true)
        {
            this.settings = settings;
            this.binder   = binder;
            this.session  = new ClientReliableSession(this, settings, binder, faultHelper, inputID);
            this.session.PollingCallback             = this.PollingCallback;
            this.session.UnblockChannelCloseCallback = this.UnblockClose;

            if (this.settings.ReliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
            {
                this.shutdownHandle = new InterruptibleWaitObject(false);
            }
            else
            {
                this.replyAckConsistencyGuard = new Guard(Int32.MaxValue);
            }

            this.binder.Faulted     += OnBinderFaulted;
            this.binder.OnException += OnBinderException;

            this.channelParameters = channelParameters;
            channelParameters.SetChannel(this);
        }
Пример #3
0
        protected override TChannel OnCreateChannel(EndpointAddress address, Uri via)
        {
            LateBoundChannelParameterCollection channelParameters = new LateBoundChannelParameterCollection();

            IClientReliableChannelBinder binder = ClientReliableChannelBinder <InnerChannel> .CreateBinder(address, via,
                                                                                                           this.InnerChannelFactory, MaskingMode.All,
                                                                                                           TolerateFaultsMode.IfNotSecuritySession, channelParameters, this.DefaultCloseTimeout,
                                                                                                           this.DefaultSendTimeout);

            if (typeof(TChannel) == typeof(IOutputSessionChannel))
            {
                if (typeof(InnerChannel) == typeof(IDuplexChannel) || typeof(InnerChannel) == typeof(IDuplexSessionChannel))
                {
                    return((TChannel)(object)new ReliableOutputSessionChannelOverDuplex(this, this, binder, this.faultHelper, channelParameters));
                }

                // typeof(InnerChannel) == typeof(IRequestChannel) || typeof(InnerChannel) == typeof(IRequestSessionChannel))
                return((TChannel)(object)new ReliableOutputSessionChannelOverRequest(this, this, binder, this.faultHelper, channelParameters));
            }
            else if (typeof(TChannel) == typeof(IDuplexSessionChannel))
            {
                return((TChannel)(object)new ClientReliableDuplexSessionChannel(this, this, binder, this.faultHelper, channelParameters, WsrmUtilities.NextSequenceId()));
            }

            // (typeof(TChannel) == typeof(IRequestSessionChannel)
            return((TChannel)(object)new ReliableRequestSessionChannel(this, this, binder, this.faultHelper, channelParameters, WsrmUtilities.NextSequenceId()));
        }
        protected ReliableOutputSessionChannel(
            ChannelManagerBase factory,
            IReliableFactorySettings settings,
            IClientReliableChannelBinder binder,
            FaultHelper faultHelper,
            LateBoundChannelParameterCollection channelParameters)
            : base(factory)
        {
            Settings = settings;
            _binder  = binder;
            _session = new ClientReliableSession(this, settings, binder, faultHelper, null);
            _session.PollingCallback             = PollingAsyncCallback;
            _session.UnblockChannelCloseCallback = UnblockClose;
            _binder.Faulted     += OnBinderFaulted;
            _binder.OnException += OnBinderException;

            _channelParameters = channelParameters;
            channelParameters.SetChannel(this);
        }
 public ReliableOutputSessionChannelOverDuplex(ChannelManagerBase factory, IReliableFactorySettings settings, IClientReliableChannelBinder binder, FaultHelper faultHelper, LateBoundChannelParameterCollection channelParameters) : base(factory, settings, binder, faultHelper, channelParameters)
 {
 }
 public ClientReliableDuplexSessionChannel(ChannelManagerBase factory, IReliableFactorySettings settings, IReliableChannelBinder binder, FaultHelper faultHelper, LateBoundChannelParameterCollection channelParameters, UniqueId inputID) : base(factory, settings, binder)
 {
     this.clientSession = new DuplexClientReliableSession(this, settings, faultHelper, inputID);
     this.clientSession.PollingCallback = new ClientReliableSession.PollingHandler(this.PollingCallback);
     base.SetSession(this.clientSession);
     this.channelParameters = channelParameters;
     channelParameters.SetChannel(this);
     ((IClientReliableChannelBinder)binder).ConnectionLost += new EventHandler(this.OnConnectionLost);
 }
 protected ReliableOutputSessionChannel(ChannelManagerBase factory, IReliableFactorySettings settings, IClientReliableChannelBinder binder, FaultHelper faultHelper, LateBoundChannelParameterCollection channelParameters) : base(factory)
 {
     this.settings = settings;
     this.binder   = binder;
     this.session  = new ClientReliableSession(this, settings, binder, faultHelper, null);
     this.session.PollingCallback             = new ClientReliableSession.PollingHandler(this.PollingCallback);
     this.session.UnblockChannelCloseCallback = new ChannelReliableSession.UnblockChannelCloseHandler(this.UnblockClose);
     this.binder.Faulted     += new BinderExceptionHandler(this.OnBinderFaulted);
     this.binder.OnException += new BinderExceptionHandler(this.OnBinderException);
     this.channelParameters   = channelParameters;
     channelParameters.SetChannel(this);
 }