ICE config cache module. (#2654)

* ICE config cache module.

* generic key type

* no ICEConfig in StartSession

* clean up
This commit is contained in:
Raja Subramanian
2024-04-16 15:49:45 +05:30
committed by GitHub
parent 5c38d58987
commit 1ab0879d28
4 changed files with 107 additions and 37 deletions
+9 -2
View File
@@ -479,7 +479,14 @@ func (r *Room) GetParticipantRequestSource(identity livekit.ParticipantIdentity)
return r.participantRequestSources[identity]
}
func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing.MessageSource, responseSink routing.MessageSink, iceServers []*livekit.ICEServer, reason livekit.ReconnectReason) error {
func (r *Room) ResumeParticipant(
p types.LocalParticipant,
requestSource routing.MessageSource,
responseSink routing.MessageSink,
iceConfig *livekit.ICEConfig,
iceServers []*livekit.ICEServer,
reason livekit.ReconnectReason,
) error {
r.ReplaceParticipantRequestSource(p.Identity(), requestSource)
// close previous sink, and link to new one
p.CloseSignalConnection(types.SignallingCloseReasonResume)
@@ -521,7 +528,7 @@ func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing
}
_ = p.SendRoomUpdate(r.ToProto())
p.ICERestart(nil)
p.ICERestart(iceConfig)
// check for simulated signal disconnect on resume
r.simulationLock.Lock()
+4 -4
View File
@@ -431,9 +431,7 @@ func (t *TransportManager) HandleClientReconnect(reason livekit.ReconnectReason)
}
func (t *TransportManager) ICERestart(iceConfig *livekit.ICEConfig) error {
if iceConfig != nil {
t.SetICEConfig(iceConfig)
}
t.SetICEConfig(iceConfig)
return t.subscriber.ICERestart()
}
@@ -445,7 +443,9 @@ func (t *TransportManager) OnICEConfigChanged(f func(iceConfig *livekit.ICEConfi
}
func (t *TransportManager) SetICEConfig(iceConfig *livekit.ICEConfig) {
t.configureICE(iceConfig, true)
if iceConfig != nil {
t.configureICE(iceConfig, true)
}
}
func (t *TransportManager) resetTransportConfigureLocked(reconfigured bool) {