add credit based mux window
This commit is contained in:
+20
-5
@@ -29,10 +29,24 @@ const (
|
||||
MuxData = 0x01
|
||||
MuxFin = 0x02
|
||||
MuxRst = 0x03
|
||||
MuxWnd = 0x04
|
||||
|
||||
FrameError = 0x7F
|
||||
|
||||
SaturationThreshold = 8
|
||||
|
||||
// Session-establishment feature flags (trailing VarInt on the Rekey message).
|
||||
FlagStreamFC = 0x01
|
||||
|
||||
// Per-stream flow-control window bounds (bytes). The advertised window is the
|
||||
// receiver's promise of how much un-credited DATA it will buffer per stream.
|
||||
DefaultStreamWindow = 256 * 1024
|
||||
MinStreamWindow = 32 * 1024
|
||||
MaxStreamWindow = 8 << 20
|
||||
|
||||
// DataChunkSize caps a single DATA frame's payload so no stream monopolizes
|
||||
// the shared worker connection for long.
|
||||
DataChunkSize = 32 * 1024
|
||||
)
|
||||
|
||||
// Mapping routes a registered pattern to a real destination.
|
||||
@@ -44,11 +58,12 @@ type Mapping struct {
|
||||
|
||||
// Config is the client configuration (PROTOCOL.md §9.2).
|
||||
type Config struct {
|
||||
Server string `json:"server"`
|
||||
PSK string `json:"psk"`
|
||||
MaxConn int `json:"maxConn"`
|
||||
PingIntervalMs int `json:"pingIntervalMs"`
|
||||
Mappings []Mapping `json:"mappings"`
|
||||
Server string `json:"server"`
|
||||
PSK string `json:"psk"`
|
||||
MaxConn int `json:"maxConn"`
|
||||
PingIntervalMs int `json:"pingIntervalMs"`
|
||||
StreamWindowBytes int `json:"streamWindowBytes"` // per-stream receive window; 0 = default
|
||||
Mappings []Mapping `json:"mappings"`
|
||||
}
|
||||
|
||||
// LoadConfig reads and validates a JSON config file.
|
||||
|
||||
Reference in New Issue
Block a user