From 3a9f63396c1b71d056260912cb3969b432a6057f Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 14 Jan 2021 02:07:00 +0100 Subject: [PATCH] Reduce delays in RelayTest. --- ice/ice.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ice/ice.go b/ice/ice.go index 82953b6..71485e8 100644 --- a/ice/ice.go +++ b/ice/ice.go @@ -125,10 +125,19 @@ func ICEConfiguration() *webrtc.Configuration { } func RelayTest() (time.Duration, error) { + conf := ICEConfiguration() conf2 := *conf conf2.ICETransportPolicy = webrtc.ICETransportPolicyRelay - pc1, err := webrtc.NewPeerConnection(conf2) + + var s webrtc.SettingEngine + s.SetHostAcceptanceMinWait(0) + s.SetSrflxAcceptanceMinWait(0) + s.SetPrflxAcceptanceMinWait(0) + s.SetRelayAcceptanceMinWait(0) + api := webrtc.NewAPI(webrtc.WithSettingEngine(s)) + + pc1, err := api.NewPeerConnection(conf2) if err != nil { return 0, err }