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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 // Therefore we need to keep track of the remote ice restart so | 352 // Therefore we need to keep track of the remote ice restart so |
353 // newer connections are prioritized over the older. | 353 // newer connections are prioritized over the older. |
354 ++remote_candidate_generation_; | 354 ++remote_candidate_generation_; |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { | 358 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { |
359 remote_ice_mode_ = mode; | 359 remote_ice_mode_ = mode; |
360 } | 360 } |
361 | 361 |
362 void P2PTransportChannel::set_receiving_timeout(int receiving_timeout_ms) { | 362 void P2PTransportChannel::SetReceivingTimeout(int receiving_timeout_ms) { |
| 363 if (receiving_timeout_ms < 0) { |
| 364 return; |
| 365 } |
363 receiving_timeout_ = receiving_timeout_ms; | 366 receiving_timeout_ = receiving_timeout_ms; |
364 check_receiving_delay_ = | 367 check_receiving_delay_ = |
365 std::max(MIN_CHECK_RECEIVING_DELAY, receiving_timeout_ / 10); | 368 std::max(MIN_CHECK_RECEIVING_DELAY, receiving_timeout_ / 10); |
| 369 LOG(LS_VERBOSE) << "Set ICE receiving timeout to " << receiving_timeout_ |
| 370 << " milliseconds"; |
366 } | 371 } |
367 | 372 |
368 // Go into the state of processing candidates, and running in general | 373 // Go into the state of processing candidates, and running in general |
369 void P2PTransportChannel::Connect() { | 374 void P2PTransportChannel::Connect() { |
370 ASSERT(worker_thread_ == rtc::Thread::Current()); | 375 ASSERT(worker_thread_ == rtc::Thread::Current()); |
371 if (ice_ufrag_.empty() || ice_pwd_.empty()) { | 376 if (ice_ufrag_.empty() || ice_pwd_.empty()) { |
372 ASSERT(false); | 377 ASSERT(false); |
373 LOG(LS_ERROR) << "P2PTransportChannel::Connect: The ice_ufrag_ and the " | 378 LOG(LS_ERROR) << "P2PTransportChannel::Connect: The ice_ufrag_ and the " |
374 << "ice_pwd_ are not set."; | 379 << "ice_pwd_ are not set."; |
375 return; | 380 return; |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1403 SignalReadPacket(this, data, len, packet_time, 0); | 1408 SignalReadPacket(this, data, len, packet_time, 0); |
1404 } | 1409 } |
1405 | 1410 |
1406 void P2PTransportChannel::OnReadyToSend(Connection* connection) { | 1411 void P2PTransportChannel::OnReadyToSend(Connection* connection) { |
1407 if (connection == best_connection_ && writable()) { | 1412 if (connection == best_connection_ && writable()) { |
1408 SignalReadyToSend(this); | 1413 SignalReadyToSend(this); |
1409 } | 1414 } |
1410 } | 1415 } |
1411 | 1416 |
1412 } // namespace cricket | 1417 } // namespace cricket |
OLD | NEW |