| OLD | NEW |
| 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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1244 // Update the receiving state. | 1244 // Update the receiving state. |
| 1245 UpdateReceiving(now); | 1245 UpdateReceiving(now); |
| 1246 if (dead(now)) { | 1246 if (dead(now)) { |
| 1247 Destroy(); | 1247 Destroy(); |
| 1248 } | 1248 } |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 void Connection::Ping(int64_t now) { | 1251 void Connection::Ping(int64_t now) { |
| 1252 last_ping_sent_ = now; | 1252 last_ping_sent_ = now; |
| 1253 ConnectionRequest *req = new ConnectionRequest(this); | 1253 ConnectionRequest *req = new ConnectionRequest(this); |
| 1254 pings_since_last_response_.push_back(SentPing(req->id(), now, nomination_)); | 1254 // If not using renomination, we use "1" to mean "nominated" and "0" to mean |
| 1255 // "not nominated". If using renomination, values greater than 1 are used for |
| 1256 // re-nominated pairs. |
| 1257 int nomination = use_candidate_attr_ ? 1 : 0; |
| 1258 if (nomination_ > 0) { |
| 1259 nomination = nomination_; |
| 1260 } |
| 1261 pings_since_last_response_.push_back(SentPing(req->id(), now, nomination)); |
| 1255 packet_loss_estimator_.ExpectResponse(req->id(), now); | 1262 packet_loss_estimator_.ExpectResponse(req->id(), now); |
| 1256 LOG_J(LS_VERBOSE, this) << "Sending STUN ping " | 1263 LOG_J(LS_VERBOSE, this) << "Sending STUN ping " |
| 1257 << ", id=" << rtc::hex_encode(req->id()) | 1264 << ", id=" << rtc::hex_encode(req->id()) |
| 1258 << ", nomination=" << nomination_; | 1265 << ", nomination=" << nomination_; |
| 1259 requests_.Send(req); | 1266 requests_.Send(req); |
| 1260 state_ = IceCandidatePairState::IN_PROGRESS; | 1267 state_ = IceCandidatePairState::IN_PROGRESS; |
| 1261 num_pings_sent_++; | 1268 num_pings_sent_++; |
| 1262 } | 1269 } |
| 1263 | 1270 |
| 1264 void Connection::ReceivedPing() { | 1271 void Connection::ReceivedPing() { |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 RTC_DCHECK(sent < 0); | 1633 RTC_DCHECK(sent < 0); |
| 1627 error_ = port_->GetError(); | 1634 error_ = port_->GetError(); |
| 1628 stats_.sent_discarded_packets++; | 1635 stats_.sent_discarded_packets++; |
| 1629 } else { | 1636 } else { |
| 1630 send_rate_tracker_.AddSamples(sent); | 1637 send_rate_tracker_.AddSamples(sent); |
| 1631 } | 1638 } |
| 1632 return sent; | 1639 return sent; |
| 1633 } | 1640 } |
| 1634 | 1641 |
| 1635 } // namespace cricket | 1642 } // namespace cricket |
| OLD | NEW |