Add methods for tweaking sctp cc to settingending

Relate: https://github.com/pion/sctp/pull/354
This commit is contained in:
cnderrauber
2025-05-19 15:20:58 +08:00
committed by cnderrauber
parent 6fd1344457
commit c5d629f4fc
2 changed files with 22 additions and 0 deletions

View File

@@ -84,6 +84,9 @@ type SettingEngine struct {
enableZeroChecksum bool
rtoMax time.Duration
maxMessageSize uint32
minCwnd uint32
fastRtxWnd uint32
cwndCAStep uint32
}
sdpMediaLevelFingerprints bool
answeringDTLSRole DTLSRole
@@ -525,6 +528,22 @@ func (e *SettingEngine) SetSCTPRTOMax(rtoMax time.Duration) {
e.sctp.rtoMax = rtoMax
}
// SetSCTPMinCwnd sets the minimum congestion window size. The congestion window
// will not be smaller than this value during congestion control.
func (e *SettingEngine) SetSCTPMinCwnd(minCwnd uint32) {
e.sctp.minCwnd = minCwnd
}
// SetSCTPFastRtxWnd sets the fast retransmission window size.
func (e *SettingEngine) SetSCTPFastRtxWnd(fastRtxWnd uint32) {
e.sctp.fastRtxWnd = fastRtxWnd
}
// SetSCTPCwndCAStep sets congestion window adjustment step size during congestion avoidance.
func (e *SettingEngine) SetSCTPCwndCAStep(cwndCAStep uint32) {
e.sctp.cwndCAStep = cwndCAStep
}
// SetICEBindingRequestHandler sets a callback that is fired on a STUN BindingRequest
// This allows users to do things like
// - Log incoming Binding Requests for debugging