add simulate switch candidate (#754)

* add simulate switch candidate

* update go mod
This commit is contained in:
cnderrauber
2022-06-07 17:56:41 +08:00
committed by GitHub
parent e72fd80ca0
commit 90ae3892b3
7 changed files with 77 additions and 11 deletions
+10 -1
View File
@@ -334,7 +334,7 @@ func (r *Room) ResumeParticipant(p types.LocalParticipant, responseSink routing.
return err
}
if err := p.ICERestart(); err != nil {
if err := p.ICERestart(nil); err != nil {
return err
}
return nil
@@ -620,6 +620,15 @@ func (r *Room) SimulateScenario(participant types.LocalParticipant, simulateScen
if err := participant.Close(true); err != nil {
return err
}
case *livekit.SimulateScenario_SwitchCandidateProtocol:
r.Logger.Infow("simulating switch candidate protocol", "participant", participant.Identity())
if err := participant.ICERestart(&types.IceConfig{
PreferSubTcp: scenario.SwitchCandidateProtocol == livekit.CandidateProtocol_TCP,
PreferPubTcp: scenario.SwitchCandidateProtocol == livekit.CandidateProtocol_TCP,
}); err != nil {
return err
}
}
return nil
}