Check for ICE connection before closing participant on signal close. (#4780)
* Check for ICE connection before closing participant on signal close. Only close the participant if ICE has not connected by the time signal source is closed. If ICE had connected, candidates have been exchanged and link was established. So, it should be resumable. Waiting for DTLS closed the participant sometimes in the windowa after ICE connection, but before DTLS finishes and that unnecessarily closed the participant forcing a full reconnect. * variable name
This commit is contained in:
@@ -867,9 +867,9 @@ func (c *RTCClient) SetAttributes(attrs map[string]string) error {
|
||||
|
||||
func (c *RTCClient) hasPrimaryEverConnected() bool {
|
||||
if c.subscriberAsPrimary.Load() {
|
||||
return c.subscriber.HasEverConnected()
|
||||
return c.subscriber.PeerConnectionHasEverConnected()
|
||||
} else {
|
||||
return c.publisher.HasEverConnected()
|
||||
return c.publisher.PeerConnectionHasEverConnected()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1113,7 +1113,7 @@ func (c *RTCClient) ensurePublisherConnected() error {
|
||||
return c.ctx.Err()
|
||||
}
|
||||
|
||||
if c.publisher.HasEverConnected() {
|
||||
if c.publisher.PeerConnectionHasEverConnected() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user