Skip to content

Commit 98a206d

Browse files
committed
Constant
1 parent 03e2dba commit 98a206d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/LiveKit/Core/DataChannelPair.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,9 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable {
370370
private static let reliableLowThreshold: UInt64 = 2 * 1024 * 1024 // 2 MB
371371
private static let lossyLowThreshold: UInt64 = reliableLowThreshold
372372

373-
// If rtc drains its buffer to 0, keep at least this amount of data for retry
374-
private static let reliableRetryAmount: UInt64 = reliableLowThreshold
373+
// If rtc drains its buffer to 0, keep at least this amount of data for retry.
374+
// Should be >= the full backpressure amount to avoid losing packets.
375+
private static let reliableRetryAmount: UInt64 = .init(Double(reliableLowThreshold) * 1.25)
375376
private static let reliableReceivedStateTTL: TimeInterval = 30
376377

377378
deinit {

0 commit comments

Comments
 (0)