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

Side by Side Diff: webrtc/p2p/base/portallocator.h

Issue 2936553003: Adding PortAllocator option to support cases where sockets can't be bound. (Closed)
Patch Set: Comment fixes Created 3 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Wi-Fi network. If a network type is "unknown", it has a cost lower than 70 // Wi-Fi network. If a network type is "unknown", it has a cost lower than
71 // cellular but higher than Wi-Fi/Ethernet. So if an unknown network exists, 71 // cellular but higher than Wi-Fi/Ethernet. So if an unknown network exists,
72 // cellular networks will not be used to gather candidates and if a Wi-Fi 72 // cellular networks will not be used to gather candidates and if a Wi-Fi
73 // network is present, "unknown" networks will not be usd to gather 73 // network is present, "unknown" networks will not be usd to gather
74 // candidates. Doing so ensures that even if a cellular network type was not 74 // candidates. Doing so ensures that even if a cellular network type was not
75 // detected initially, it would not be used if a Wi-Fi network is present. 75 // detected initially, it would not be used if a Wi-Fi network is present.
76 PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000, 76 PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000,
77 77
78 // When specified, do not collect IPv6 ICE candidates on Wi-Fi. 78 // When specified, do not collect IPv6 ICE candidates on Wi-Fi.
79 PORTALLOCATOR_ENABLE_IPV6_ON_WIFI = 0x4000, 79 PORTALLOCATOR_ENABLE_IPV6_ON_WIFI = 0x4000,
80
81 // When this flag is set, ports will be created not bound to any specific
pthatcher1 2017/06/13 19:52:50 "created not bound" => "created but not bound"
Taylor Brandstetter 2017/06/13 22:11:18 Revised comment.
82 // network interface, in addition to normal ports. Without this flag, these
83 // ports would only be used when network enumeration fails or is disabled.
84 // But under certain conditions, these ports may succeed where others fail,
85 // so they may allow the application to work in a wider variety of
86 // environments, at the expense of having to allocate additional candidates.
87 PORTALLOCATOR_ENABLE_ANY_ADDRESS_PORTS = 0x8000,
80 }; 88 };
81 89
82 // Defines various reasons that have caused ICE regathering. 90 // Defines various reasons that have caused ICE regathering.
83 enum class IceRegatheringReason { NETWORK_CHANGE, NETWORK_FAILURE, MAX_VALUE }; 91 enum class IceRegatheringReason { NETWORK_CHANGE, NETWORK_FAILURE, MAX_VALUE };
84 92
85 const uint32_t kDefaultPortAllocatorFlags = 0; 93 const uint32_t kDefaultPortAllocatorFlags = 0;
86 94
87 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. 95 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay.
88 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain 96 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain
89 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. 97 // internal. Less than 20ms is not acceptable. We choose 50ms as our default.
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 470 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
463 bool candidate_pool_frozen_ = false; 471 bool candidate_pool_frozen_ = false;
464 bool prune_turn_ports_ = false; 472 bool prune_turn_ports_ = false;
465 473
466 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; 474 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr;
467 }; 475 };
468 476
469 } // namespace cricket 477 } // namespace cricket
470 478
471 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 479 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698