internal override void OnFlow(Flow flow)
{
Delivery delivery = null;
lock (this.ThisLock)
{
this.credit = (flow.DeliveryCount + flow.LinkCredit) - this.deliveryCount;
if (this.writing || this.credit <= 0 || this.outgoingList.First == null)
{
return;
}
delivery = (Delivery)this.outgoingList.First;
this.outgoingList.Remove(delivery);
delivery.Tag = Delivery.GetDeliveryTag(this.deliveryCount);
this.credit--;
this.deliveryCount++;
this.writing = true;
}
this.WriteDelivery(delivery);
}