Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: webrtc/p2p/base/port.cc

Issue 2670113002: Pick the DTLS handshake timeout based on the ICE RTT estimate (Closed)
Patch Set: Rename InitialHandshakeRetransmissionTimeout -> InitialRetransmissionTimeout. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 if (iter != pings_since_last_response_.end() && 1245 if (iter != pings_since_last_response_.end() &&
1246 iter->nomination > acked_nomination_) { 1246 iter->nomination > acked_nomination_) {
1247 acked_nomination_ = iter->nomination; 1247 acked_nomination_ = iter->nomination;
1248 } 1248 }
1249 1249
1250 pings_since_last_response_.clear(); 1250 pings_since_last_response_.clear();
1251 last_ping_response_received_ = rtc::TimeMillis(); 1251 last_ping_response_received_ = rtc::TimeMillis();
1252 UpdateReceiving(last_ping_response_received_); 1252 UpdateReceiving(last_ping_response_received_);
1253 set_write_state(STATE_WRITABLE); 1253 set_write_state(STATE_WRITABLE);
1254 set_state(IceCandidatePairState::SUCCEEDED); 1254 set_state(IceCandidatePairState::SUCCEEDED);
1255 if (rtt_samples_ > 0) {
1256 rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1);
1257 } else {
1258 rtt_ = rtt;
1259 }
1255 rtt_samples_++; 1260 rtt_samples_++;
1256 rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1);
1257 } 1261 }
1258 1262
1259 bool Connection::dead(int64_t now) const { 1263 bool Connection::dead(int64_t now) const {
1260 if (last_received() > 0) { 1264 if (last_received() > 0) {
1261 // If it has ever received anything, we keep it alive until it hasn't 1265 // If it has ever received anything, we keep it alive until it hasn't
1262 // received anything for DEAD_CONNECTION_RECEIVE_TIMEOUT. This covers the 1266 // received anything for DEAD_CONNECTION_RECEIVE_TIMEOUT. This covers the
1263 // normal case of a successfully used connection that stops working. This 1267 // normal case of a successfully used connection that stops working. This
1264 // also allows a remote peer to continue pinging over a locally inactive 1268 // also allows a remote peer to continue pinging over a locally inactive
1265 // (pruned) connection. 1269 // (pruned) connection.
1266 return (now > (last_received() + DEAD_CONNECTION_RECEIVE_TIMEOUT)); 1270 return (now > (last_received() + DEAD_CONNECTION_RECEIVE_TIMEOUT));
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 RTC_DCHECK(sent < 0); 1587 RTC_DCHECK(sent < 0);
1584 error_ = port_->GetError(); 1588 error_ = port_->GetError();
1585 stats_.sent_discarded_packets++; 1589 stats_.sent_discarded_packets++;
1586 } else { 1590 } else {
1587 send_rate_tracker_.AddSamples(sent); 1591 send_rate_tracker_.AddSamples(sent);
1588 } 1592 }
1589 return sent; 1593 return sent;
1590 } 1594 }
1591 1595
1592 } // namespace cricket 1596 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698