mirror of
https://github.com/livekit/livekit.git
synced 2026-08-25 22:29:45 +00:00
Apply ICE preference when switching to TCP on unstable UDP (#4703)
onMediaLossUpdate notified the participant handler directly, which only sends a leave request with resume action. handleConnectionFailed that actually switches the ICE preference to TCP/TLS was never called on this path, so the client reconnected over UDP again and the fallback kept firing every 30-60s without ever migrating. Fixes livekit/livekit#4702
This commit is contained in:
@@ -976,6 +976,11 @@ func (t *TransportManager) onMediaLossUpdate(loss uint8) {
|
||||
t.lock.Unlock()
|
||||
|
||||
t.params.Logger.Infow("udp connection unstable, switch to tcp", "signalingRTT", t.signalingRTT)
|
||||
// switch ICE preference to TCP before asking the client to resume,
|
||||
// the raw params handler only sends a leave request and does not
|
||||
// reconfigure the transport, so the client would reconnect over UDP
|
||||
// again and this path would keep firing
|
||||
t.handleConnectionFailed(true)
|
||||
if t.params.UseSinglePeerConnection {
|
||||
t.params.PublisherHandler.OnFailed(true, t.publisher.GetICEConnectionInfo())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user