implement basic connection level flow control

fixes #39
This commit is contained in:
Marten Seemann
2016-05-18 17:30:08 +07:00
parent 7105b37f91
commit f147ebc9bb
11 changed files with 319 additions and 41 deletions

View File

@@ -62,6 +62,14 @@ func MaxInt64(a, b int64) int64 {
return b
}
// MinByteCount returns the minimum of two ByteCounts
func MinByteCount(a, b protocol.ByteCount) protocol.ByteCount {
if a < b {
return a
}
return b
}
// MaxDuration returns the max duration
func MaxDuration(a, b time.Duration) time.Duration {
if a > b {