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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // interface as seen by regular http traffic and the HOST candidate associated | 53 // interface as seen by regular http traffic and the HOST candidate associated |
54 // with the default local interface. | 54 // with the default local interface. |
55 PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION = 0x400, | 55 PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION = 0x400, |
56 // When specified along with PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION, the | 56 // When specified along with PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION, the |
57 // default local candidate mentioned above will not be allocated. Only the | 57 // default local candidate mentioned above will not be allocated. Only the |
58 // STUN candidate will be. | 58 // STUN candidate will be. |
59 PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE = 0x800, | 59 PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE = 0x800, |
60 // Disallow use of UDP when connecting to a relay server. Since proxy servers | 60 // Disallow use of UDP when connecting to a relay server. Since proxy servers |
61 // usually don't handle UDP, using UDP will leak the IP address. | 61 // usually don't handle UDP, using UDP will leak the IP address. |
62 PORTALLOCATOR_DISABLE_UDP_RELAY = 0x1000, | 62 PORTALLOCATOR_DISABLE_UDP_RELAY = 0x1000, |
| 63 |
| 64 // When multiple networks exist, do not gather candidates on the ones with |
| 65 // high cost. So if both Wi-Fi and cellular networks exist, gather only on the |
| 66 // Wi-Fi network. If a network type is "unknown", it has a cost lower than |
| 67 // cellular but higher than Wi-Fi/Ethernet. So if an unknown network exists, |
| 68 // cellular networks will not be used to gather candidates and if a Wi-Fi |
| 69 // network is present, "unknown" networks will not be usd to gather |
| 70 // candidates. Doing so ensures that even if a cellular network type was not |
| 71 // detected initially, it would not be used if a Wi-Fi network is present. |
| 72 PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000, |
63 }; | 73 }; |
64 | 74 |
65 const uint32_t kDefaultPortAllocatorFlags = 0; | 75 const uint32_t kDefaultPortAllocatorFlags = 0; |
66 | 76 |
67 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. | 77 const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. |
68 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain | 78 // As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain |
69 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. | 79 // internal. Less than 20ms is not acceptable. We choose 50ms as our default. |
70 const uint32_t kMinimumStepDelay = 50; | 80 const uint32_t kMinimumStepDelay = 50; |
71 | 81 |
72 // CF = CANDIDATE FILTER | 82 // CF = CANDIDATE FILTER |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 int target_pooled_session_count_ = 0; | 348 int target_pooled_session_count_ = 0; |
339 // This variable represents the total number of pooled sessions | 349 // This variable represents the total number of pooled sessions |
340 // both owned by this class and taken by TakePooledSession. | 350 // both owned by this class and taken by TakePooledSession. |
341 int allocated_pooled_session_count_ = 0; | 351 int allocated_pooled_session_count_ = 0; |
342 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 352 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
343 }; | 353 }; |
344 | 354 |
345 } // namespace cricket | 355 } // namespace cricket |
346 | 356 |
347 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 357 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
OLD | NEW |