Inheritance: Microsoft.Azure.Amqp.Framing.Performative
        /// <summary>
        /// Client receives the sasl outcome from the server.
        /// </summary>
        void OnSaslOutcome(SaslOutcome outcome)
        {
            Exception exception = null;

            if (outcome.OutcomeCode.Value != SaslCode.Ok)
            {
                exception = new UnauthorizedAccessException(outcome.OutcomeCode.Value.ToString());
            }

            this.CompleteNegotiation(outcome.OutcomeCode.Value, exception);
        }
        public void CompleteNegotiation(SaslCode code, Exception exception)
        {
            this.state             = SaslState.End;
            this.completeException = exception;

            if (!this.isInitiator)
            {
                SaslOutcome outcome = new SaslOutcome();
                outcome.OutcomeCode = code;
                if (code == SaslCode.Ok)
                {
                    outcome.AdditionalData = new ArraySegment <byte>(Encoding.UTF8.GetBytes(welcome));
                }

                // transported is completed in the callback
                this.WriteFrame(outcome, false);
            }
            else
            {
                this.CompleteTransport();
            }
        }
Example #3
0
        /// <summary>
        /// Client receives the sasl outcome from the server.
        /// </summary>
        void OnSaslOutcome(SaslOutcome outcome)
        {
            Exception exception = null;
            if (outcome.OutcomeCode.Value != SaslCode.Ok)
            {
                exception = new UnauthorizedAccessException(outcome.OutcomeCode.Value.ToString());
            }

            this.CompleteNegotiation(outcome.OutcomeCode.Value, exception);
        }
Example #4
0
        public void CompleteNegotiation(SaslCode code, Exception exception)
        {
            this.state = SaslState.End;
            this.completeException = exception;

            if (!this.isInitiator)
            {
                SaslOutcome outcome = new SaslOutcome();
                outcome.OutcomeCode = code;
                if (code == SaslCode.Ok)
                {
                    outcome.AdditionalData = new ArraySegment<byte>(Encoding.UTF8.GetBytes(welcome));
                }

                // transported is completed in the callback
                this.WriteFrame(outcome, false);
            }
            else
            {
                this.CompleteTransport();
            }
        }