func (t *evolveInterval) Init(amb *dccp.Amb, push pushIntervalFunc) { t.amb = amb.Refine("evolveInterval") t.push = push t.lastSeqNo = 0 t.lastTime = 0 t.lastRTT = 0 t.clearInterval() }
// Init resets the senderRoundtripEstimator object for new use func (t *senderRoundtripEstimator) Init(amb *dccp.Amb) { t.amb = amb.Refine("senderRoundtripEstimator") t.estimate = 0 t.k = 0 for i, _ := range t.history { t.history[i] = sendTime{} // Zero Time indicates no data } }
// Init resets the rate calculator for new use and returns the initial // allowed sending rate (in bytes per second). The latter is the rate // to be used before the first feedback packet is received and hence before // an RTT estimate is available. func (t *senderRateCalculator) Init(amb *dccp.Amb, ss uint32, rtt int64) { t.amb = amb.Refine("senderRateCalculator") // The allowed sending rate before the first feedback packet is received // is one packet per second. t.x = ss t.recoverRate = ss // tld = 0 indicates that the first feedback packet has yet not been received. t.tld = 0 // Because X_recv_set is initialized with a single item, with value Infinity, recvLimit is // set to Infinity for the first two round-trip times of the connection. As a result, the // sending rate is not limited by the receive rate during that period. This avoids the // problem of the sending rate being limited by the value of X_recv from the first feedback // packet. t.recvLimit = X_RECV_MAX t.hasFeedback = false t.lossRateInv = UnknownLossEventRateInv t.ss = ss t.rtt = rtt t.xRecvSet.Init() }
// Init initializes the RTT estimator func (t *receiverRoundtripEstimator) Init(amb *dccp.Amb) { t.amb = amb.Refine("receiverRoundtripEstimator") t.rtt = 0 t.rttTime = 0 }
func newReceiver(env *dccp.Env, amb *dccp.Amb) *receiver { return &receiver{env: env, amb: amb.Refine("receiver")} }
func newSender(env *dccp.Env, amb *dccp.Amb) *sender { return &sender{env: env, amb: amb.Refine("sender")} }
// Init resets the senderStrober instance for new use func (s *senderStrober) Init(env *dccp.Env, amb *dccp.Amb, bps uint32, ss uint32) { s.env = env s.amb = amb.Refine("strober") s.SetRate(bps, ss) }
// Init resets the senderLossTracker instance for new use func (t *senderLossTracker) Init(amb *dccp.Amb) { t.amb = amb.Refine("senderLossTracker") t.lastAckNo = 0 t.lastRateInv = UnknownLossEventRateInv t.lossRateCalculator.Init(NINTERVAL) }