mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 07:06:51 +08:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user