本文整理汇总了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)
}