Change initial DTLS retransmission timer from 1 second to 50ms.
This will help ensure a timely DTLS handshake when there's packet
loss. It will likely result in spurious retransmissions (since the
RTT is usually > 50ms), but since exponential backoff is still used,
there will at most be ~4 extra retransmissions. For a time-sensitive
application like WebRTC this seems like a reasonable tradeoff.
R=pthatcher@webrtc.org, juberti@chromium.org, juberti@webrtc.org
Review URL: https://codereview.webrtc.org/1981463002 .
Committed: https://crrev.com/1e435628366fb9fed71632369f05928ed857d8ef
Cr-Original-Commit-Position: refs/heads/master@{#13159}
Cr-Original-Original-Commit-Position: refs/heads/master@{#12853}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 4f0dfbd213aaad0b8b32b0cf0101b47aea039770
diff --git a/base/timeutils.cc b/base/timeutils.cc
index 3c89d80..1be368e 100644
--- a/base/timeutils.cc
+++ b/base/timeutils.cc
@@ -38,10 +38,7 @@
return prev;
}
-uint64_t TimeNanos() {
- if (g_clock) {
- return g_clock->TimeNanos();
- }
+uint64_t SystemTimeNanos() {
int64_t ticks;
#if defined(WEBRTC_MAC)
static mach_timebase_info_data_t timebase;
@@ -86,6 +83,17 @@
return ticks;
}
+int64_t SystemTimeMillis() {
+ return static_cast<int64_t>(SystemTimeNanos() / kNumNanosecsPerMillisec);
+}
+
+uint64_t TimeNanos() {
+ if (g_clock) {
+ return g_clock->TimeNanos();
+ }
+ return SystemTimeNanos();
+}
+
uint32_t Time32() {
return static_cast<uint32_t>(TimeNanos() / kNumNanosecsPerMillisec);
}