Max recv buf size via SettingEngine

Relates to pion/sctp#218
This commit is contained in:
Yutaka Takeda
2022-04-23 13:27:32 -07:00
parent 9f990dbca4
commit eb1f6ad2db
2 changed files with 12 additions and 2 deletions

View File

@@ -54,6 +54,9 @@ type SettingEngine struct {
dtls struct {
retransmissionInterval time.Duration
}
sctp struct {
maxReceiveBufferSize uint32
}
sdpMediaLevelFingerprints bool
answeringDTLSRole DTLSRole
disableCertificateFingerprintVerification bool
@@ -304,3 +307,9 @@ func (e *SettingEngine) SetReceiveMTU(receiveMTU uint) {
func (e *SettingEngine) SetDTLSRetransmissionInterval(interval time.Duration) {
e.dtls.retransmissionInterval = interval
}
// SetSCTPMaxReceiveBufferSize sets the maximum receive buffer size.
// Leave this 0 for the default maxReceiveBufferSize.
func (e *SettingEngine) SetSCTPMaxReceiveBufferSize(maxReceiveBufferSize uint32) {
e.sctp.maxReceiveBufferSize = maxReceiveBufferSize
}