상속: Performative
예제 #1
0
            public void OnBegin(Begin begin)
            {
                lock (this.SyncRoot)
                {
                    // Can happen in pipeline mode
                    uint alreadySent = this.Session.settings.OutgoingWindow.Value - this.outgoingWindow;
                    if (alreadySent > begin.IncomingWindow.Value)
                    {
                        this.outgoingWindow = 0;
                    }
                    else
                    {
                        this.outgoingWindow = begin.IncomingWindow.Value - alreadySent;
                    }

                    this.Session.settings.OutgoingWindow = this.outgoingWindow;
                }
            }
예제 #2
0
 Error Negotiate(Begin begin)
 {
     this.outgoingChannel.OnBegin(begin);
     this.UpdateHandleTable(begin);
     return null;
 }
예제 #3
0
        void OnReceiveBegin(Begin begin)
        {
            StateTransition stateTransition = this.TransitState("R:BEGIN", StateTransition.ReceiveOpen);

            this.incomingChannel.OnBegin(begin);
            if (stateTransition.To == AmqpObjectState.OpenReceived)
            {
                this.outgoingChannel.OnBegin(begin);
                this.UpdateHandleTable(begin);
                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.SafeClose(exception);
                }
            }
        }
예제 #4
0
 void UpdateHandleTable(Begin begin)
 {
     this.settings.HandleMax = Math.Min(this.settings.HandleMax(), begin.HandleMax());
     this.linksByLocalHandle.SetMaxHandle(this.settings.HandleMax.Value);
     this.linksByRemoteHandle.SetMaxHandle(this.settings.HandleMax.Value);
 }
예제 #5
0
 public void OnBegin(Begin begin)
 {
     lock (this.SyncRoot)
     {
         this.nextIncomingId = begin.NextOutgoingId.Value;
     }
 }