Wait for fully established to ensure data channel is ready (#949)
This commit is contained in:
@@ -615,7 +615,7 @@ func (c *RTCClient) ensurePublisherConnected() error {
|
|||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return fmt.Errorf("could not connect publisher after timeout")
|
return fmt.Errorf("could not connect publisher after timeout")
|
||||||
case <-time.After(10 * time.Millisecond):
|
case <-time.After(10 * time.Millisecond):
|
||||||
if c.publisher.HasEverConnected() {
|
if c.publisherFullyEstablished.Load() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user