コード例 #1
0
            bool Complete(TimeSpan timeout)
            {
                IAsyncResult result = null;

                if (this.currentTransaction != null)
                {
                    using (TransactionScope scope = new TransactionScope(this.currentTransaction))
                    {
                        TransactionOutcomeListener.EnsureReceiveContextAbandonOnTransactionRollback(this.receiveContext, this.currentTransaction, this.channelHandler);
                        result = this.receiveContext.BeginComplete(
                            timeout,
                            completeCallback,
                            this);
                        scope.Complete();
                    }
                }
                else
                {
                    result = this.receiveContext.BeginComplete(
                        timeout,
                        completeCallback,
                        this);
                }

                if (result.CompletedSynchronously)
                {
                    return(HandleComplete(result));
                }
                return(false);
            }
コード例 #2
0
        //Called from RPC.DisposeRequestContext for sucessful invoke.
        //Mode is RCBA.ManualAcknowledgement = false.
        public IAsyncResult BeginComplete(TimeSpan timeout, Transaction transaction, ChannelHandler channelHandler, AsyncCallback callback, object state)
        {
            IAsyncResult result = null;

            if (transaction != null)
            {
                using (TransactionScope scope = new TransactionScope(transaction))
                {
                    TransactionOutcomeListener.EnsureReceiveContextAbandonOnTransactionRollback(this.receiveContext, transaction, channelHandler);
                    result = this.receiveContext.BeginComplete(
                        timeout,
                        callback,
                        state);
                    scope.Complete();
                }
            }
            else
            {
                result = this.receiveContext.BeginComplete(
                    timeout,
                    callback,
                    state);
            }
            return(result);
        }