Add SetDTLSConnectContextMaker to SettingEngine

Allows a user to set the context used during the DTLS Handshake. This
can be used to extend or reduce the timeout on the DTLS Handshake.

Resolves #2477
This commit is contained in:
lisa yan
2023-05-19 10:34:41 +08:00
committed by Sean DuBois
parent c1bec495a3
commit 4d3c4b13b1
3 changed files with 23 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
package webrtc
import (
"context"
"net"
"testing"
"time"
@@ -252,6 +253,14 @@ func TestSetDTLSEllipticCurves(t *testing.T) {
}
}
func TestSetDTLSHandShakeTimeout(*testing.T) {
s := SettingEngine{}
s.SetDTLSConnectContextMaker(func() (context.Context, func()) {
return context.WithTimeout(context.Background(), 60*time.Second)
})
}
func TestSetSCTPMaxReceiverBufferSize(t *testing.T) {
s := SettingEngine{}
assert.Equal(t, uint32(0), s.sctp.maxReceiveBufferSize)