| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 const std::string& ice_pwd() const { return ice_pwd_; } | 151 const std::string& ice_pwd() const { return ice_pwd_; } |
| 152 bool pooled() const { return ice_ufrag_.empty(); } | 152 bool pooled() const { return ice_ufrag_.empty(); } |
| 153 | 153 |
| 154 // Setting this filter should affect not only candidates gathered in the | 154 // Setting this filter should affect not only candidates gathered in the |
| 155 // future, but candidates already gathered and ports already "ready", | 155 // future, but candidates already gathered and ports already "ready", |
| 156 // which would be returned by ReadyCandidates() and ReadyPorts(). | 156 // which would be returned by ReadyCandidates() and ReadyPorts(). |
| 157 // | 157 // |
| 158 // Default filter should be CF_ALL. | 158 // Default filter should be CF_ALL. |
| 159 virtual void SetCandidateFilter(uint32_t filter) = 0; | 159 virtual void SetCandidateFilter(uint32_t filter) = 0; |
| 160 | 160 |
| 161 // Starts gathering STUN and Relay configurations. | 161 // Starts gathering ports and ICE candidates. |
| 162 virtual void StartGettingPorts() = 0; | 162 virtual void StartGettingPorts() = 0; |
| 163 // Completely stops the gathering process and will not start new ones. | 163 // Completely stops gathering. Will not gather again unless StartGettingPorts |
| 164 // is called again. |
| 164 virtual void StopGettingPorts() = 0; | 165 virtual void StopGettingPorts() = 0; |
| 165 // Whether the session is actively getting ports. | 166 // Whether the session is actively getting ports. |
| 166 virtual bool IsGettingPorts() = 0; | 167 virtual bool IsGettingPorts() = 0; |
| 167 // ClearGettingPorts and IsCleared are used by continual gathering. | 168 |
| 168 // Only stops the existing gathering process but may start new ones if needed. | 169 // |
| 170 // NOTE: The group of methods below is only used for continual gathering. |
| 171 // |
| 172 |
| 173 // ClearGettingPorts should have the same immediate effect as |
| 174 // StopGettingPorts, but if the implementation supports continual gathering, |
| 175 // ClearGettingPorts allows additional ports/candidates to be gathered if the |
| 176 // network conditions change. |
| 169 virtual void ClearGettingPorts() = 0; | 177 virtual void ClearGettingPorts() = 0; |
| 170 // Whether it is in the state where the existing gathering process is stopped, | 178 // Whether it is in the state where the existing gathering process is stopped, |
| 171 // but new ones may be started (basically after calling ClearGettingPorts). | 179 // but new ones may be started (basically after calling ClearGettingPorts). |
| 172 virtual bool IsCleared() const { return false; } | 180 virtual bool IsCleared() const { return false; } |
| 173 // Whether the session has completely stopped. | 181 // Whether the session has completely stopped. |
| 174 virtual bool IsStopped() const { return false; } | 182 virtual bool IsStopped() const { return false; } |
| 175 // Re-gathers candidates on networks that do not have any connections. More | 183 // Re-gathers candidates on networks that do not have any connections. More |
| 176 // precisely, a network interface may have more than one IP addresses (e.g., | 184 // precisely, a network interface may have more than one IP addresses (e.g., |
| 177 // IPv4 and IPv6 addresses). Each address subnet will be used to create a | 185 // IPv4 and IPv6 addresses). Each address subnet will be used to create a |
| 178 // network. Only if all networks of an interface have no connection, the | 186 // network. Only if all networks of an interface have no connection, the |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // This variable represents the total number of pooled sessions | 395 // This variable represents the total number of pooled sessions |
| 388 // both owned by this class and taken by TakePooledSession. | 396 // both owned by this class and taken by TakePooledSession. |
| 389 int allocated_pooled_session_count_ = 0; | 397 int allocated_pooled_session_count_ = 0; |
| 390 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; | 398 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
| 391 bool prune_turn_ports_ = false; | 399 bool prune_turn_ports_ = false; |
| 392 }; | 400 }; |
| 393 | 401 |
| 394 } // namespace cricket | 402 } // namespace cricket |
| 395 | 403 |
| 396 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ | 404 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ |
| OLD | NEW |