| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 bool Done() { | 178 bool Done() { |
| 179 return num_request_sent_ >= requests_per_ip_ * all_servers_addrs_.size(); | 179 return num_request_sent_ >= requests_per_ip_ * all_servers_addrs_.size(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 size_t total_socket_required() { | 182 size_t total_socket_required() { |
| 183 return (shared_socket_mode_ ? 1 : all_servers_addrs_.size()) * | 183 return (shared_socket_mode_ ? 1 : all_servers_addrs_.size()) * |
| 184 requests_per_ip_; | 184 requests_per_ip_; |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool should_send_next_request(uint32_t now); | 187 bool should_send_next_request(int64_t now); |
| 188 int get_wake_up_interval_ms(); | 188 int get_wake_up_interval_ms(); |
| 189 | 189 |
| 190 bool SendNextRequest(); | 190 bool SendNextRequest(); |
| 191 | 191 |
| 192 // Will be invoked in 1ms intervals and schedule the next request from the | 192 // Will be invoked in 1ms intervals and schedule the next request from the |
| 193 // |current_requester_| if the time has passed for another request. | 193 // |current_requester_| if the time has passed for another request. |
| 194 void MaybeScheduleStunRequests(); | 194 void MaybeScheduleStunRequests(); |
| 195 | 195 |
| 196 void ReportOnPrepared(StunProber::Status status); | 196 void ReportOnPrepared(StunProber::Status status); |
| 197 void ReportOnFinished(StunProber::Status status); | 197 void ReportOnFinished(StunProber::Status status); |
| 198 | 198 |
| 199 Requester* CreateRequester(); | 199 Requester* CreateRequester(); |
| 200 | 200 |
| 201 Requester* current_requester_ = nullptr; | 201 Requester* current_requester_ = nullptr; |
| 202 | 202 |
| 203 // The time when the next request should go out. | 203 // The time when the next request should go out. |
| 204 uint64_t next_request_time_ms_ = 0; | 204 int64_t next_request_time_ms_ = 0; |
| 205 | 205 |
| 206 // Total requests sent so far. | 206 // Total requests sent so far. |
| 207 uint32_t num_request_sent_ = 0; | 207 uint32_t num_request_sent_ = 0; |
| 208 | 208 |
| 209 bool shared_socket_mode_ = false; | 209 bool shared_socket_mode_ = false; |
| 210 | 210 |
| 211 // How many requests should be done against each resolved IP. | 211 // How many requests should be done against each resolved IP. |
| 212 uint32_t requests_per_ip_ = 0; | 212 uint32_t requests_per_ip_ = 0; |
| 213 | 213 |
| 214 // Milliseconds to pause between each STUN request. | 214 // Milliseconds to pause between each STUN request. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 245 ObserverAdapter observer_adapter_; | 245 ObserverAdapter observer_adapter_; |
| 246 | 246 |
| 247 rtc::NetworkManager::NetworkList networks_; | 247 rtc::NetworkManager::NetworkList networks_; |
| 248 | 248 |
| 249 RTC_DISALLOW_COPY_AND_ASSIGN(StunProber); | 249 RTC_DISALLOW_COPY_AND_ASSIGN(StunProber); |
| 250 }; | 250 }; |
| 251 | 251 |
| 252 } // namespace stunprober | 252 } // namespace stunprober |
| 253 | 253 |
| 254 #endif // WEBRTC_P2P_STUNPROBER_STUNPROBER_H_ | 254 #endif // WEBRTC_P2P_STUNPROBER_STUNPROBER_H_ |
| OLD | NEW |