コード例 #1
0
        public static AmqpSessionSettings Create(Begin begin)
        {
            AmqpSessionSettings settings = new AmqpSessionSettings();
            settings.IncomingWindow = begin.OutgoingWindow;
            settings.OutgoingWindow = begin.IncomingWindow;
            settings.HandleMax = Math.Min(settings.HandleMax.Value, begin.HandleMax());

            return settings;
        }
コード例 #2
0
ファイル: AmqpSession.cs プロジェクト: modulexcite/IL2JS
 public void OnBegin(Begin begin)
 {
     lock (this.SyncRoot)
     {
         if (begin.IncomingWindow.Value == uint.MaxValue)
         {
             this.outgoingWindow = this.remoteIncomingWindow = uint.MaxValue;
         }
         else
         {
             // Can happen in pipeline mode
             uint alreadySent = this.Session.settings.OutgoingWindow.Value - this.outgoingWindow;
             if (alreadySent > begin.IncomingWindow.Value)
             {
                 this.remoteIncomingWindow = 0;
                 this.outgoingWindow = 0;
             }
             else
             {
                 this.remoteIncomingWindow = begin.IncomingWindow.Value - alreadySent;
                 this.outgoingWindow = this.remoteIncomingWindow;
             }
         }
     }
 }
コード例 #3
0
ファイル: AmqpSession.cs プロジェクト: modulexcite/IL2JS
        void OnReceiveBegin(Begin begin)
        {
            StateTransition stateTransition;
            this.TransitState("R:BEGIN", StateTransition.ReceiveOpen, out stateTransition);

            this.incomingChannel.OnBegin(begin);
            if (stateTransition.To == AmqpObjectState.OpenReceived)
            {
                this.Open();
            }
            else
            {
                Exception exception = null;
                Error error = this.Negotiate(begin);
                if (error != null)
                {
                    exception = new AmqpException(error);
                }

                this.CompleteOpen(false, exception);
                if (exception != null)
                {
                    this.TryClose(exception);
                }
            }
        }
コード例 #4
0
ファイル: AmqpSession.cs プロジェクト: modulexcite/IL2JS
        Error Negotiate(Begin begin)
        {
            this.outgoingChannel.OnBegin(begin);
            if (begin.HandleMax.HasValue)
            {
                this.settings.HandleMax = Math.Min(this.settings.HandleMax.Value, begin.HandleMax.Value);
            }

            return null;
        }
コード例 #5
0
ファイル: AmqpSession.cs プロジェクト: modulexcite/IL2JS
 public void OnBegin(Begin begin)
 {
     lock (this.SyncRoot)
     {
         this.nextIncomingId = begin.NextOutgoingId.Value;
     }
 }