Session.last_cycle

Reset count of OutboundItem's weight. We decrements weight each time DATA is sent to simulate resource sharing. We use priority queue and larger weight has the precedence. If weight is reached to lowest weight, it resets to its initial weight. If this happens, other items which have the lower weight currently but same initial weight cannot send DATA until item having large weight is decreased. To avoid this, we use this cycle variable. Initally, this is set to 1. If weight gets lowest weight, and if item's cycle == last_cycle, we increments last_cycle and assigns it to item's cycle. Otherwise, just assign last_cycle. In priority queue comparator, we first compare items' cycle value. Lower cycle value has the precedence.

class Session
package
ulong last_cycle;

Meta