Inheritance: LinkPerformative
Ejemplo n.º 1
0
        void OnReceiveFlow(Flow flow)
        {
            this.outgoingChannel.OnFlow(flow);
            this.incomingChannel.OnFlow(flow);

            if (flow.Handle.HasValue)
            {
                AmqpLink link = null;
                if (!this.linksByRemoteHandle.TryGetObject(flow.Handle.Value, out link))
                {
                    if (this.Settings.IgnoreMissingLinks)
                    {
                        AmqpTrace.Provider.AmqpMissingHandle(this, "link", flow.Handle.Value);
                        return;
                    }

                    this.SafeClose(new AmqpException(AmqpErrorCode.UnattachedHandle, AmqpResources.GetString(AmqpResources.AmqpHandleNotFound, flow.Handle.Value, this)));
                    return;
                }

                link.OnFlow(flow);
            }
            else if (flow.Echo())
            {
                this.SendFlow();
            }
        }
Ejemplo n.º 2
0
 public void SendFlow(Flow flow)
 {
     lock (this.SyncRoot)
     {
         // Outgoing state needs to be sync'ed with transfers
         this.AddFlowState(flow, false);
         this.Session.incomingChannel.AddFlowState(flow, true);
         this.Session.SendCommand(flow, null);
     }
 }
Ejemplo n.º 3
0
 public void SendFlow(Flow flow)
 {
     lock (this.ThisLock)
     {
         if (!this.IsClosing())
         {
             this.outgoingChannel.SendFlow(flow);
         }
     }
 }
Ejemplo n.º 4
0
            public void AddFlowState(Flow flow, bool reset)
            {
                lock (this.SyncRoot)
                {
                    flow.NextIncomingId = this.nextIncomingId.Value;
                    flow.IncomingWindow = this.incomingWindow;

                    if (reset)
                    {
                        this.needFlowCount = 0;
                    }
                }
            }
Ejemplo n.º 5
0
 public void OnFlow(Flow flow)
 {
 }
Ejemplo n.º 6
0
 public void AddFlowState(Flow flow, bool reset)
 {
     lock (this.SyncRoot)
     {
         flow.OutgoingWindow = this.outgoingWindow;
         flow.NextOutgoingId = this.nextOutgoingId.Value;
     }
 }
Ejemplo n.º 7
0
            public void OnFlow(Flow flow)
            {
                uint remoteWindow = 0;
                lock (this.SyncRoot)
                {
                    if (flow.IncomingWindow.Value < uint.MaxValue)
                    {
                        uint flowNextIncomingId = flow.NextIncomingId ?? 0;
                        this.outgoingWindow = flowNextIncomingId + flow.IncomingWindow.Value - this.nextOutgoingId.Value;
                        remoteWindow = this.outgoingWindow;
                    }
                    else
                    {
                        // only notify links when the current window control is on
                        remoteWindow = this.outgoingWindow == uint.MaxValue ? 0 : uint.MaxValue;
                        this.outgoingWindow = uint.MaxValue;
                    }
                }

                if (remoteWindow > 0)
                {
                    this.Session.NotifyCreditAvailable(remoteWindow > int.MaxValue ? int.MaxValue : (int)remoteWindow);
                }
            }