Example #1
0
 /// <summary>
 /// Initializes a sender link.
 /// </summary>
 /// <param name="session">The session within which to create the link.</param>
 /// <param name="name">The link name.</param>
 /// <param name="attach">The attach frame to send for this link.</param>
 /// <param name="onAttached">The callback to invoke when an attach is received from peer.</param>
 public SenderLink(Session session, string name, Attach attach, OnAttached onAttached)
     : base(session, name, onAttached)
 {
     this.settleMode = attach.SndSettleMode;
     this.outgoingList = new LinkedList();
     this.SendAttach(false, this.deliveryCount, attach);
 }
Example #2
0
        internal Session(Connection connection, Begin begin)
        {
            this.connection = connection;
            this.channel = connection.AddSession(this);
            this.handleMax = begin.HandleMax;
            this.localLinks = new Link[1];
            this.remoteLinks = new Link[1];
            this.incomingList = new LinkedList();
            this.outgoingList = new LinkedList();
            this.nextOutgoingId = uint.MaxValue - 2u;
            this.outgoingWindow = begin.IncomingWindow;
            this.incomingDeliveryId = uint.MaxValue;

            begin.NextOutgoingId = this.nextOutgoingId;
            this.state = State.BeginSent;
            this.SendBegin(begin);
        }
Example #3
0
 /// <summary>
 /// Initializes a receiver link.
 /// </summary>
 /// <param name="session">The session within which to create the link.</param>
 /// <param name="name">The link name.</param>
 /// <param name="attach">The attach frame to send for this link.</param>
 /// <param name="onAttached">The callback to invoke when an attach is received from peer.</param>
 public ReceiverLink(Session session, string name, Attach attach, OnAttached onAttached)
     : base(session, name, onAttached)
 {
     this.totalCredit = -1;
     this.receivedMessages = new LinkedList();
     this.waiterList = new LinkedList();
     this.SendAttach(true, 0, attach);
 }
Example #4
0
        internal Delivery RemoveDeliveries(Link link)
        {
            LinkedList list = null;
            lock (this.ThisLock)
            {
                Delivery temp = (Delivery)this.outgoingList.First;
                while (temp != null)
                {
                    Delivery curr = temp;
                    temp = (Delivery)temp.Next;
                    if (curr.Link == link)
                    {
                        this.outgoingList.Remove(curr);
                        if (list == null)
                        {
                            list = new LinkedList();
                        }

                        list.Add(curr);
                    }
                }
            }

            return list == null ? null : (Delivery)list.First;
        }