send WindowUpdate frames

fixes #19
This commit is contained in:
Marten Seemann
2016-05-15 16:46:34 +07:00
parent 540941117e
commit a3ff4dd891
6 changed files with 115 additions and 27 deletions

View File

@@ -28,9 +28,13 @@ const SmallPacketSendDelay = 500 * time.Microsecond
// TODO: set a reasonable value here
const ReceiveStreamFlowControlWindow ByteCount = (1 << 20) // 1 MB
// ReceiveStreamFlowControlWindowIncrement is the amount that the stream-level flow control window is increased when sending a WindowUpdate
const ReceiveStreamFlowControlWindowIncrement = ReceiveStreamFlowControlWindow
// ReceiveConnectionFlowControlWindow is the stream-level flow control window for receiving data
// temporarily set this to a very high value, until proper connection-level flow control is implemented
// TODO: set a reasonable value here
const ReceiveConnectionFlowControlWindow ByteCount = (1 << 20) // 1 MB
const ReceiveConnectionFlowControlWindow ByteCount = (1 << 20) * 1024 * 2 // 2 GB
// MaxStreamsPerConnection is the maximum value accepted for the number of streams per connection
// TODO: set a reasonable value here
@@ -39,3 +43,6 @@ const MaxStreamsPerConnection uint32 = 100
// MaxIdleConnectionStateLifetime is the maximum value accepted for the idle connection state lifetime
// TODO: set a reasonable value here
const MaxIdleConnectionStateLifetime = 60 * time.Second
// WindowUpdateThreshold is the size of the receive flow control window for which we send out a WindowUpdate frame
const WindowUpdateThreshold = ReceiveStreamFlowControlWindow / 2