// up-down: from application to link to session (to send a disposition) public void DisposeDelivery(Delivery delivery, bool settled, DeliveryState state) { Utils.Trace(TraceLevel.Verbose, "{0}: Dispose delivery (id={1}, settle={2}, state={3}).", this, delivery.DeliveryId, settled, state); if (settled && !delivery.Settled) { lock (this.syncRoot) { if (!this.unsettledMap.Remove(delivery.DeliveryTag)) { delivery.State = new Rejected() { Error = AmqpError.NotFound }; delivery.Complete(); return; } } } this.Session.DisposeDelivery(this, delivery, settled, state); if (delivery.Settled) { delivery.Complete(); this.CheckFlow(); } }
// bottom-up: from session disposition to link to application public void OnDisposeDelivery(Delivery delivery) { if (delivery.Settled) { lock (this.syncRoot) { this.unsettledMap.Remove(delivery.DeliveryTag); } delivery.Complete(); this.CheckFlow(); } }
protected void AbortDelivery(Delivery delivery) { delivery.State = AmqpConstants.ReleasedOutcome; delivery.Complete(); }