当前位置: 首页>>代码示例>>Golang>>正文


Golang dccp.Amb类代码示例

本文整理汇总了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()
}
开发者ID:hashken,项目名称:GoDCCP,代码行数:8,代码来源:lossinterval.go

示例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
	}
}
开发者ID:hashken,项目名称:GoDCCP,代码行数:9,代码来源:roundtrip.go

示例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()
}
开发者ID:hashken,项目名称:GoDCCP,代码行数:24,代码来源:x.go

示例4: newReceiver

func newReceiver(env *dccp.Env, amb *dccp.Amb) *receiver {
	return &receiver{env: env, amb: amb.Refine("receiver")}
}
开发者ID:niltonkummer,项目名称:GoDCCP,代码行数:3,代码来源:receiver.go

示例5: newSender

func newSender(env *dccp.Env, amb *dccp.Amb) *sender {
	return &sender{env: env, amb: amb.Refine("sender")}
}
开发者ID:hashken,项目名称:GoDCCP,代码行数:3,代码来源:sender.go

示例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)
}
开发者ID:niltonkummer,项目名称:GoDCCP,代码行数:6,代码来源:strober.go

示例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)
}
开发者ID:niltonkummer,项目名称:GoDCCP,代码行数:7,代码来源:senderloss.go


注:本文中的github.com/petar/GoDCCP/dccp.Amb类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。