本文整理匯總了Golang中github.com/petar/GoDCCP/dccp.Amb類的典型用法代碼示例。如果您正苦於以下問題:Golang Amb類的具體用法?Golang Amb怎麽用?Golang Amb使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Amb類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Init
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()
}
示例2: Init
// 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
}
}
示例3: Init
// 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()
}
示例4: newReceiver
func newReceiver(env *dccp.Env, amb *dccp.Amb) *receiver {
return &receiver{env: env, amb: amb.Refine("receiver")}
}
示例5: newSender
func newSender(env *dccp.Env, amb *dccp.Amb) *sender {
return &sender{env: env, amb: amb.Refine("sender")}
}
示例6: Init
// 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)
}
示例7: Init
// 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)
}