close disconnected participants when signal channel fails (#1895)

* close disconnected participants when signal channel fails

* fix typefake

* update reason
This commit is contained in:
Paul Wells
2023-07-20 19:23:35 -07:00
committed by GitHub
parent 6ad1e1598d
commit 3980d049c9
4 changed files with 41 additions and 1 deletions
+9
View File
@@ -516,6 +516,15 @@ func (p *ParticipantImpl) OnClaimsChanged(callback func(types.LocalParticipant))
p.lock.Unlock()
}
func (p *ParticipantImpl) HandleSignalSourceClose() {
p.TransportManager.SetSignalSourceValid(false)
if !p.TransportManager.HasPublisherEverConnected() && !p.TransportManager.HasSubscriberEverConnected() {
p.params.Logger.Infow("closing disconnected participant")
_ = p.Close(false, types.ParticipantCloseReasonJoinFailed, false)
}
}
// HandleOffer an offer from remote participant, used when clients make the initial connection
func (p *ParticipantImpl) HandleOffer(offer webrtc.SessionDescription) {
p.params.Logger.Debugw("received offer", "transport", livekit.SignalTarget_PUBLISHER)