mirror of
https://github.com/pion/webrtc.git
synced 2025-10-04 06:46:35 +08:00
Add EnableDataChannelBlockWrite to SettingEngine
The settingengine can enabled block write if datachannel is detached, makes it working like a normal net.Conn.
This commit is contained in:
@@ -103,6 +103,7 @@ type SettingEngine struct {
|
||||
iceMaxBindingRequests *uint16
|
||||
fireOnTrackBeforeFirstRTP bool
|
||||
disableCloseByDTLS bool
|
||||
dataChannelBlockWrite bool
|
||||
}
|
||||
|
||||
// getReceiveMTU returns the configured MTU. If SettingEngine's MTU is configured to 0 it returns the default
|
||||
@@ -121,6 +122,12 @@ func (e *SettingEngine) DetachDataChannels() {
|
||||
e.detach.DataChannels = true
|
||||
}
|
||||
|
||||
// EnableDataChannelBlockWrite allows data channels to block on write,
|
||||
// it only works if DetachDataChannels is enabled
|
||||
func (e *SettingEngine) EnableDataChannelBlockWrite(nonblockWrite bool) {
|
||||
e.dataChannelBlockWrite = nonblockWrite
|
||||
}
|
||||
|
||||
// SetSRTPProtectionProfiles allows the user to override the default SRTP Protection Profiles
|
||||
// The default srtp protection profiles are provided by the function `defaultSrtpProtectionProfiles`
|
||||
func (e *SettingEngine) SetSRTPProtectionProfiles(profiles ...dtls.SRTPProtectionProfile) {
|
||||
|
Reference in New Issue
Block a user