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

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

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Add tests Created 4 years, 6 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
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 Connection* Port::GetConnection(const rtc::SocketAddress& remote_addr) { 232 Connection* Port::GetConnection(const rtc::SocketAddress& remote_addr) {
233 AddressMap::const_iterator iter = connections_.find(remote_addr); 233 AddressMap::const_iterator iter = connections_.find(remote_addr);
234 if (iter != connections_.end()) 234 if (iter != connections_.end())
235 return iter->second; 235 return iter->second;
236 else 236 else
237 return NULL; 237 return NULL;
238 } 238 }
239 239
240 void Port::FailAndDestroyConnections() {
241 for (auto kv : connections_) {
242 kv.second->FailAndDestroy();
243 }
244 }
245
240 void Port::AddAddress(const rtc::SocketAddress& address, 246 void Port::AddAddress(const rtc::SocketAddress& address,
241 const rtc::SocketAddress& base_address, 247 const rtc::SocketAddress& base_address,
242 const rtc::SocketAddress& related_address, 248 const rtc::SocketAddress& related_address,
243 const std::string& protocol, 249 const std::string& protocol,
244 const std::string& relay_protocol, 250 const std::string& relay_protocol,
245 const std::string& tcptype, 251 const std::string& tcptype,
246 const std::string& type, 252 const std::string& type,
247 uint32_t type_preference, 253 uint32_t type_preference,
248 uint32_t relay_preference, 254 uint32_t relay_preference,
249 bool final) { 255 bool final) {
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 ASSERT(sent < 0); 1514 ASSERT(sent < 0);
1509 error_ = port_->GetError(); 1515 error_ = port_->GetError();
1510 stats_.sent_discarded_packets++; 1516 stats_.sent_discarded_packets++;
1511 } else { 1517 } else {
1512 send_rate_tracker_.AddSamples(sent); 1518 send_rate_tracker_.AddSamples(sent);
1513 } 1519 }
1514 return sent; 1520 return sent;
1515 } 1521 }
1516 1522
1517 } // namespace cricket 1523 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698