當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。