public ContextChannelRequestContext(RequestContext innerContext, ContextProtocol contextProtocol, TimeSpan defaultSendTimeout)
 {
     if (innerContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerContext");
     }
     if (contextProtocol == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contextProtocol");
     }
     this.innerContext = innerContext;
     this.contextProtocol = contextProtocol;
     this.defaultSendTimeout = defaultSendTimeout;
 }
Ejemplo n.º 2
0
 public ContextChannelRequestContext(RequestContext innerContext, ContextProtocol contextProtocol, TimeSpan defaultSendTimeout)
 {
     if (innerContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("innerContext");
     }
     if (contextProtocol == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contextProtocol");
     }
     this.innerContext       = innerContext;
     this.contextProtocol    = contextProtocol;
     this.defaultSendTimeout = defaultSendTimeout;
 }
 public ContextReplySessionChannel(ChannelManagerBase channelManager, IReplySessionChannel innerChannel, ContextExchangeMechanism contextExchangeMechanism)
     : base(channelManager, innerChannel)
 {
     this.contextProtocol = new ServiceContextProtocol(contextExchangeMechanism);
 }
 public ContextDuplexSessionChannel(ChannelManagerBase channelManager, IDuplexSessionChannel innerChannel,
                                    ContextExchangeMechanism contextExchangeMechanism, Uri address, Uri callbackAddress, bool contextManagementEnabled)
     : base(channelManager, innerChannel)
 {
     this.contextProtocol = new ClientContextProtocol(contextExchangeMechanism, address, this, callbackAddress, contextManagementEnabled);
 }
 protected ContextRequestChannelBase(ChannelManagerBase channelManager, TChannel innerChannel, ContextExchangeMechanism contextExchangeMechanism, Uri callbackAddress, bool contextManagementEnabled) : base(channelManager, innerChannel)
 {
     this.contextProtocol = new ClientContextProtocol(contextExchangeMechanism, innerChannel.Via, this, callbackAddress, contextManagementEnabled);
 }
Ejemplo n.º 6
0
            public SendAsyncResult(Message message, ContextOutputChannelBase <TChannel> channel, ContextProtocol contextProtocol, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state)
            {
                this.channel       = channel;
                this.message       = this.sendMessage = message;
                this.timeoutHelper = new TimeoutHelper(timeout);
                bool flag = true;

                if (message != null)
                {
                    contextProtocol.OnOutgoingMessage(message, null);
                    if (CorrelationCallbackMessageProperty.TryGet(message, out this.correlationCallback))
                    {
                        ContextExchangeCorrelationHelper.AddOutgoingCorrelationCallbackData(this.correlationCallback, message, this.channel.IsClient);
                        if (this.correlationCallback.IsFullyDefined)
                        {
                            IAsyncResult result = this.correlationCallback.BeginFinalizeCorrelation(this.message, this.timeoutHelper.RemainingTime(), ContextOutputChannelBase <TChannel> .SendAsyncResult.onFinalizeCorrelation, this);
                            if (result.CompletedSynchronously && this.OnFinalizeCorrelationCompleted(result))
                            {
                                base.Complete(true);
                            }
                            flag = false;
                        }
                    }
                }
                if (flag)
                {
                    IAsyncResult result2 = this.channel.InnerChannel.BeginSend(this.message, this.timeoutHelper.RemainingTime(), ContextOutputChannelBase <TChannel> .SendAsyncResult.onSend, this);
                    if (result2.CompletedSynchronously)
                    {
                        this.OnSendCompleted(result2);
                        base.Complete(true);
                    }
                }
            }