Add option to issue full reconnect on a publication error. (#1214)

* Add option to issue full reconnect on a publication error.

Leaving the publication error timeout at 30 seconds as there
are some publications taking long. Also, there are cases
where the peer connection fails after 30 seconds. The peer
connection failure happens after publication error is detected.
But, 30 seconds is a good amount of time for publication to establish.

* prevent recursive lock
This commit is contained in:
Raja Subramanian
2022-12-06 14:46:59 +05:30
committed by GitHub
parent 6f27d683a9
commit 6bd5504bff
6 changed files with 90 additions and 36 deletions
+6
View File
@@ -280,6 +280,11 @@ func (r *RoomManager) StartSession(
if r.config.RTC.AllowTCPFallback != nil {
allowFallback = *r.config.RTC.AllowTCPFallback
}
// default do not force full reconnect on a publication error
reconnectOnPublicationError := false
if r.config.RTC.ReconnectOnPublicationError != nil {
reconnectOnPublicationError = *r.config.RTC.ReconnectOnPublicationError
}
participant, err = rtc.NewParticipant(rtc.ParticipantParams{
Identity: pi.Identity,
Name: pi.Name,
@@ -307,6 +312,7 @@ func (r *RoomManager) StartSession(
}
return nil
},
ReconnectOnPublicationError: reconnectOnPublicationError,
})
if err != nil {
return err