ICE config cache module. (#2654)
* ICE config cache module. * generic key type * no ICEConfig in StartSession * clean up
This commit is contained in:
+9
-2
@@ -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()
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user