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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 running_ = true; | 185 running_ = true; |
186 network_thread_->Post(this, MSG_CONFIG_START); | 186 network_thread_->Post(this, MSG_CONFIG_START); |
187 | 187 |
188 if (flags() & PORTALLOCATOR_ENABLE_SHAKER) | 188 if (flags() & PORTALLOCATOR_ENABLE_SHAKER) |
189 network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE); | 189 network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE); |
190 } | 190 } |
191 | 191 |
192 void BasicPortAllocatorSession::StopGettingPorts() { | 192 void BasicPortAllocatorSession::StopGettingPorts() { |
193 ASSERT(rtc::Thread::Current() == network_thread_); | 193 ASSERT(rtc::Thread::Current() == network_thread_); |
194 running_ = false; | 194 running_ = false; |
| 195 network_thread_->Post(this, MSG_CONFIG_STOP); |
| 196 ClearGettingPorts(); |
| 197 } |
| 198 |
| 199 void BasicPortAllocatorSession::ClearGettingPorts() { |
195 network_thread_->Clear(this, MSG_ALLOCATE); | 200 network_thread_->Clear(this, MSG_ALLOCATE); |
196 for (uint32 i = 0; i < sequences_.size(); ++i) | 201 for (uint32 i = 0; i < sequences_.size(); ++i) |
197 sequences_[i]->Stop(); | 202 sequences_[i]->Stop(); |
198 network_thread_->Post(this, MSG_CONFIG_STOP); | |
199 } | 203 } |
200 | 204 |
201 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) { | 205 void BasicPortAllocatorSession::OnMessage(rtc::Message *message) { |
202 switch (message->message_id) { | 206 switch (message->message_id) { |
203 case MSG_CONFIG_START: | 207 case MSG_CONFIG_START: |
204 ASSERT(rtc::Thread::Current() == network_thread_); | 208 ASSERT(rtc::Thread::Current() == network_thread_); |
205 GetPortConfigurations(); | 209 GetPortConfigurations(); |
206 break; | 210 break; |
207 | 211 |
208 case MSG_CONFIG_READY: | 212 case MSG_CONFIG_READY: |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 ServerAddresses servers; | 1175 ServerAddresses servers; |
1172 for (size_t i = 0; i < relays.size(); ++i) { | 1176 for (size_t i = 0; i < relays.size(); ++i) { |
1173 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1177 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
1174 servers.insert(relays[i].ports.front().address); | 1178 servers.insert(relays[i].ports.front().address); |
1175 } | 1179 } |
1176 } | 1180 } |
1177 return servers; | 1181 return servers; |
1178 } | 1182 } |
1179 | 1183 |
1180 } // namespace cricket | 1184 } // namespace cricket |
OLD | NEW |