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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // We need to keep track of the remote ice restart so newer | 348 // We need to keep track of the remote ice restart so newer |
349 // connections are prioritized over the older. | 349 // connections are prioritized over the older. |
350 ++remote_candidate_generation_; | 350 ++remote_candidate_generation_; |
351 } | 351 } |
352 } | 352 } |
353 | 353 |
354 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { | 354 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { |
355 remote_ice_mode_ = mode; | 355 remote_ice_mode_ = mode; |
356 } | 356 } |
357 | 357 |
358 void P2PTransportChannel::SetReceivingTimeout(int receiving_timeout_ms) { | 358 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { |
359 if (receiving_timeout_ms < 0) { | 359 gather_continually_ = config.gather_continually; |
| 360 LOG(LS_INFO) << "Set gather_continually to " << gather_continually_; |
| 361 |
| 362 if (config.receiving_timeout_ms < 0) { |
360 return; | 363 return; |
361 } | 364 } |
362 receiving_timeout_ = receiving_timeout_ms; | 365 receiving_timeout_ = config.receiving_timeout_ms; |
363 check_receiving_delay_ = | 366 check_receiving_delay_ = |
364 std::max(MIN_CHECK_RECEIVING_DELAY, receiving_timeout_ / 10); | 367 std::max(MIN_CHECK_RECEIVING_DELAY, receiving_timeout_ / 10); |
365 | 368 |
366 for (Connection* connection : connections_) { | 369 for (Connection* connection : connections_) { |
367 connection->set_receiving_timeout(receiving_timeout_); | 370 connection->set_receiving_timeout(receiving_timeout_); |
368 } | 371 } |
369 LOG(LS_VERBOSE) << "Set ICE receiving timeout to " << receiving_timeout_ | 372 LOG(LS_INFO) << "Set ICE receiving timeout to " << receiving_timeout_ |
370 << " milliseconds"; | 373 << " milliseconds"; |
371 } | 374 } |
372 | 375 |
373 // Go into the state of processing candidates, and running in general | 376 // Go into the state of processing candidates, and running in general |
374 void P2PTransportChannel::Connect() { | 377 void P2PTransportChannel::Connect() { |
375 ASSERT(worker_thread_ == rtc::Thread::Current()); | 378 ASSERT(worker_thread_ == rtc::Thread::Current()); |
376 if (ice_ufrag_.empty() || ice_pwd_.empty()) { | 379 if (ice_ufrag_.empty() || ice_pwd_.empty()) { |
377 ASSERT(false); | 380 ASSERT(false); |
378 LOG(LS_ERROR) << "P2PTransportChannel::Connect: The ice_ufrag_ and the " | 381 LOG(LS_ERROR) << "P2PTransportChannel::Connect: The ice_ufrag_ and the " |
379 << "ice_pwd_ are not set."; | 382 << "ice_pwd_ are not set."; |
380 return; | 383 return; |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 } | 1345 } |
1343 } | 1346 } |
1344 | 1347 |
1345 void P2PTransportChannel::OnReadyToSend(Connection* connection) { | 1348 void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
1346 if (connection == best_connection_ && writable()) { | 1349 if (connection == best_connection_ && writable()) { |
1347 SignalReadyToSend(this); | 1350 SignalReadyToSend(this); |
1348 } | 1351 } |
1349 } | 1352 } |
1350 | 1353 |
1351 } // namespace cricket | 1354 } // namespace cricket |
OLD | NEW |