Skip to content

Commit

Permalink
Add MaxBindingRequests to SettingEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
daweifeng authored and Sean-Der committed Feb 3, 2024
1 parent ca0b939 commit 906f20c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions icegatherer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (g *ICEGatherer) createAgent() error {
UDPMux: g.api.settingEngine.iceUDPMux,
ProxyDialer: g.api.settingEngine.iceProxyDialer,
DisableActiveTCP: g.api.settingEngine.iceDisableActiveTCP,
MaxBindingRequests: g.api.settingEngine.iceMaxBindingRequests,
}

requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes
Expand Down
7 changes: 7 additions & 0 deletions settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type SettingEngine struct {
disableMediaEngineCopy bool
srtpProtectionProfiles []dtls.SRTPProtectionProfile
receiveMTU uint
iceMaxBindingRequests *uint16
}

// getReceiveMTU returns the configured MTU. If SettingEngine's MTU is configured to 0 it returns the default
Expand Down Expand Up @@ -340,6 +341,12 @@ func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
e.iceProxyDialer = d
}

// SetICEMaxBindingRequests sets the maximum amount of binding requests
// that can be sent on a candidate before it is considered invalid.
func (e *SettingEngine) SetICEMaxBindingRequests(d uint16) {
e.iceMaxBindingRequests = &d
}

// DisableActiveTCP disables using active TCP for ICE. Active TCP is enabled by default
func (e *SettingEngine) DisableActiveTCP(isDisabled bool) {
e.iceDisableActiveTCP = isDisabled
Expand Down

0 comments on commit 906f20c

Please sign in to comment.