assignBandwidth

Assigns one round's worth of bandwidth from the most-limiting channel and withdraws it from every channel. Returns the number of bytes assigned this call. Faithful to bw_request::assign_bandwidth:

  • the request can take at most requestSize - assigned more bytes;

  • each channel's share is distributeQuota * priority / tmp, and the channel that allows the least caps the assignment (this skips unlimited channels, which have throttle 0, and channels with no competing priority);

  • ttl decrements every call regardless.