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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 246 } |
247 | 247 |
248 network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_START); | 248 network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_START); |
249 | 249 |
250 LOG(LS_INFO) << "Pruning turn ports " | 250 LOG(LS_INFO) << "Pruning turn ports " |
251 << (prune_turn_ports_ ? "enabled" : "disabled"); | 251 << (prune_turn_ports_ ? "enabled" : "disabled"); |
252 } | 252 } |
253 | 253 |
254 void BasicPortAllocatorSession::StopGettingPorts() { | 254 void BasicPortAllocatorSession::StopGettingPorts() { |
255 ASSERT(rtc::Thread::Current() == network_thread_); | 255 ASSERT(rtc::Thread::Current() == network_thread_); |
256 network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_STOP); | |
257 ClearGettingPorts(); | 256 ClearGettingPorts(); |
258 // Note: this must be called after ClearGettingPorts because both may set the | 257 // Note: this must be called after ClearGettingPorts because both may set the |
259 // session state and we should set the state to STOPPED. | 258 // session state and we should set the state to STOPPED. |
260 state_ = SessionState::STOPPED; | 259 state_ = SessionState::STOPPED; |
261 } | 260 } |
262 | 261 |
263 void BasicPortAllocatorSession::ClearGettingPorts() { | 262 void BasicPortAllocatorSession::ClearGettingPorts() { |
264 ASSERT(rtc::Thread::Current() == network_thread_); | 263 ASSERT(rtc::Thread::Current() == network_thread_); |
265 network_thread_->Clear(this, MSG_ALLOCATE); | 264 network_thread_->Clear(this, MSG_ALLOCATE); |
266 for (uint32_t i = 0; i < sequences_.size(); ++i) { | 265 for (uint32_t i = 0; i < sequences_.size(); ++i) { |
267 sequences_[i]->Stop(); | 266 sequences_[i]->Stop(); |
268 } | 267 } |
| 268 network_thread_->Post(RTC_FROM_HERE, this, MSG_CONFIG_STOP); |
269 state_ = SessionState::CLEARED; | 269 state_ = SessionState::CLEARED; |
270 } | 270 } |
271 | 271 |
272 std::vector<rtc::Network*> BasicPortAllocatorSession::GetFailedNetworks() { | 272 std::vector<rtc::Network*> BasicPortAllocatorSession::GetFailedNetworks() { |
273 std::vector<rtc::Network*> networks = GetNetworks(); | 273 std::vector<rtc::Network*> networks = GetNetworks(); |
274 | 274 |
275 // A network interface may have both IPv4 and IPv6 networks. Only if | 275 // A network interface may have both IPv4 and IPv6 networks. Only if |
276 // neither of the networks has any connections, the network interface | 276 // neither of the networks has any connections, the network interface |
277 // is considered failed and need to be regathered on. | 277 // is considered failed and need to be regathered on. |
278 std::set<std::string> networks_with_connection; | 278 std::set<std::string> networks_with_connection; |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 ServerAddresses servers; | 1461 ServerAddresses servers; |
1462 for (size_t i = 0; i < relays.size(); ++i) { | 1462 for (size_t i = 0; i < relays.size(); ++i) { |
1463 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1463 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
1464 servers.insert(relays[i].ports.front().address); | 1464 servers.insert(relays[i].ports.front().address); |
1465 } | 1465 } |
1466 } | 1466 } |
1467 return servers; | 1467 return servers; |
1468 } | 1468 } |
1469 | 1469 |
1470 } // namespace cricket | 1470 } // namespace cricket |
OLD | NEW |