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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Public for unit tests. | 200 // Public for unit tests. |
201 PortAllocatorSession* allocator_session() { | 201 PortAllocatorSession* allocator_session() { |
202 return allocator_sessions_.back().get(); | 202 return allocator_sessions_.back().get(); |
203 } | 203 } |
204 | 204 |
205 // Public for unit tests. | 205 // Public for unit tests. |
206 const std::vector<RemoteCandidate>& remote_candidates() const { | 206 const std::vector<RemoteCandidate>& remote_candidates() const { |
207 return remote_candidates_; | 207 return remote_candidates_; |
208 } | 208 } |
209 | 209 |
| 210 // Public for unit tests. |
| 211 void set_peer_supports_renomination(bool peer_supports_renomination) { |
| 212 peer_supports_renomination_ = peer_supports_renomination; |
| 213 } |
| 214 |
210 private: | 215 private: |
211 rtc::Thread* thread() const { return worker_thread_; } | 216 rtc::Thread* thread() const { return worker_thread_; } |
212 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } | 217 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } |
213 | 218 |
214 // A transport channel is weak if the current best connection is either | 219 // A transport channel is weak if the current best connection is either |
215 // not receiving or not writable, or if there is no best connection at all. | 220 // not receiving or not writable, or if there is no best connection at all. |
216 bool weak() const; | 221 bool weak() const; |
217 // Returns true if it's possible to send packets on this channel. | 222 // Returns true if it's possible to send packets on this channel. |
218 bool ReadyToSend() const; | 223 bool ReadyToSend() const; |
219 void UpdateConnectionStates(); | 224 void UpdateConnectionStates(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 uint64_t tiebreaker_; | 401 uint64_t tiebreaker_; |
397 IceGatheringState gathering_state_; | 402 IceGatheringState gathering_state_; |
398 | 403 |
399 int check_receiving_interval_; | 404 int check_receiving_interval_; |
400 int64_t last_ping_sent_ms_ = 0; | 405 int64_t last_ping_sent_ms_ = 0; |
401 int weak_ping_interval_ = WEAK_PING_INTERVAL; | 406 int weak_ping_interval_ = WEAK_PING_INTERVAL; |
402 TransportChannelState state_ = TransportChannelState::STATE_INIT; | 407 TransportChannelState state_ = TransportChannelState::STATE_INIT; |
403 IceConfig config_; | 408 IceConfig config_; |
404 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. | 409 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. |
405 bool started_pinging_ = false; | 410 bool started_pinging_ = false; |
| 411 // Its value will be set in subsequent CLs based on signaling exchange. |
| 412 bool peer_supports_renomination_ = false; |
| 413 // The value put in the "nomination" attribute for the next nominated |
| 414 // connection. A zero-value indicates the connection will not be nominated. |
| 415 // Because we are implementing aggressive nomination, set the default value to |
| 416 // 1. |
| 417 int nominating_value_ = 1; |
406 | 418 |
407 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 419 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
408 }; | 420 }; |
409 | 421 |
410 } // namespace cricket | 422 } // namespace cricket |
411 | 423 |
412 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 424 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
OLD | NEW |