mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 07:36:10 -04:00
Extend endpoint disconnection timeout.
This extends the endpoint disconnection timeout to be slightly longer than the WebRTC connection attempt timeout. This allows an in-progress bandwidth upgrade to resolve before we clean up the endpoint. Failing to properly clean up the bandwidth upgrade can lead to a delay when shutting down Nearby Connections and can crash the process instead of allowing a clean shutdown. PiperOrigin-RevId: 496750001
This commit is contained in:
@@ -238,8 +238,11 @@ class EndpointManager {
|
||||
static void WaitForLatch(const std::string& method_name,
|
||||
CountDownLatch* latch, std::int32_t timeout_millis);
|
||||
|
||||
// We set this to 11s to provide sufficient time for an in-progress WebRTC
|
||||
// bandwidth upgrade to resolve. This is chosen to be slightly longer than the
|
||||
// 10s timeout in WebRtc::AttemptToConnect().
|
||||
static constexpr absl::Duration kProcessEndpointDisconnectionTimeout =
|
||||
absl::Milliseconds(2000);
|
||||
absl::Milliseconds(11000);
|
||||
static constexpr absl::Time kInvalidTimestamp = absl::InfinitePast();
|
||||
|
||||
// It should be noted that this method may be called multiple times (because
|
||||
|
||||
Reference in New Issue
Block a user