qlog lost packets

This commit is contained in:
Marten Seemann
2020-01-27 16:39:03 +07:00
parent f13ca7e791
commit 5a7f743733
7 changed files with 101 additions and 11 deletions

View File

@@ -90,3 +90,23 @@ func (t packetType) String() string {
panic("unknown packet type")
}
}
type PacketLossReason uint8
const (
// PacketLossReorderingThreshold: when a packet is deemed lost due to reordering threshold
PacketLossReorderingThreshold PacketLossReason = iota
// PacketLossTimeThreshold: when a packet is deemed lost due to time threshold
PacketLossTimeThreshold
)
func (r PacketLossReason) String() string {
switch r {
case PacketLossReorderingThreshold:
return "reordering_threshold"
case PacketLossTimeThreshold:
return "time_threshold"
default:
panic("unknown loss reason")
}
}