コード例 #1
0
        public async Task <IServiceChannelDispatcher> CreateServiceChannelDispatcherAsync(IChannel channel)
        {
            ServiceChannel.SessionIdleManager sessionIdleManager = channel.GetProperty <ServiceChannel.SessionIdleManager>();
            IChannelBinder binder = null;

            if (channel is IReplyChannel)
            {
                ReplyChannelBinder rcbinder = channel.GetProperty <ReplyChannelBinder>();
                rcbinder.Init(channel as IReplyChannel, BaseAddress);
                binder = rcbinder;
            }
            else if (channel is IDuplexSessionChannel)
            {
                DuplexChannelBinder dcbinder = channel.GetProperty <DuplexChannelBinder>();
                dcbinder.Init(channel as IDuplexSessionChannel, _requestReplyCorrelator, BaseAddress);
                binder = dcbinder;
            }
            else if (channel is IInputChannel)
            {
                InputChannelBinder icbinder = channel.GetProperty <InputChannelBinder>();
                icbinder.Init(channel as IInputChannel, BaseAddress);
                binder = icbinder;
            }

            // TODO: Wire up wasChannelThrottled
            var channelHandler = new ChannelHandler(Binding.MessageVersion, binder, channel.GetProperty <ServiceThrottle>(),
                                                    this, /*wasChannelThrottled*/ false, sessionIdleManager);

            IServiceChannelDispatcher channelDispatcher = channelHandler.GetDispatcher();
            //   channel.ChannelDispatcher = channelDispatcher;
            await channelHandler.OpenAsync();

            return(channelDispatcher);
        }
コード例 #2
0
ファイル: InputChannelBinder.cs プロジェクト: suneths/CoreWCF
 internal InputRequestContext(Message request, InputChannelBinder binder)
     : base(request, TimeSpan.Zero, TimeSpan.Zero)
 {
     this.binder = binder;
 }