delay transmission of small packets to wait for new data

fixes #9, fixes #61
This commit is contained in:
Marten Seemann
2016-05-13 17:06:30 +07:00
parent c0c7be16e3
commit ba799cef01
4 changed files with 137 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
package protocol
import "time"
// A PacketNumber in QUIC
type PacketNumber uint64
@@ -55,3 +57,10 @@ const DefaultMaxCongestionWindow PacketNumber = 107
// MaxUndecryptablePackets limits the number of undecryptable packets that a
// session queues for later until it sends a public reset.
const MaxUndecryptablePackets = 10
// SmallPacketPayloadSizeThreshold defines a threshold for small packets
// if the packet payload size (i.e. the packet without public header and private header) is below SmallPacketSizeThreshold, sending will be delayed by SmallPacketSendDelay
const SmallPacketPayloadSizeThreshold = MaxPacketSize / 2
// SmallPacketSendDelay is the time delay applied to small packets
const SmallPacketSendDelay = 500 * time.Microsecond