add simulate switch candidate (#754)
* add simulate switch candidate * update go mod
This commit is contained in:
+10
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user