| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // A transport channel is weak if the current best connection is either | 173 // A transport channel is weak if the current best connection is either |
| 174 // not receiving or not writable, or if there is no best connection at all. | 174 // not receiving or not writable, or if there is no best connection at all. |
| 175 bool weak() const; | 175 bool weak() const; |
| 176 void UpdateConnectionStates(); | 176 void UpdateConnectionStates(); |
| 177 void RequestSort(); | 177 void RequestSort(); |
| 178 void SortConnections(); | 178 void SortConnections(); |
| 179 void SwitchBestConnectionTo(Connection* conn); | 179 void SwitchBestConnectionTo(Connection* conn); |
| 180 void UpdateChannelState(); | 180 void UpdateChannelState(); |
| 181 void HandleAllTimedOut(); | 181 void HandleAllTimedOut(); |
| 182 void MaybeStopPortAllocatorSessions(); | 182 void MaybeStopPortAllocatorSessions(); |
| 183 TransportChannelState GetStateInternal() const; |
| 183 | 184 |
| 184 Connection* GetBestConnectionOnNetwork(rtc::Network* network) const; | 185 Connection* GetBestConnectionOnNetwork(rtc::Network* network) const; |
| 185 bool CreateConnections(const Candidate& remote_candidate, | 186 bool CreateConnections(const Candidate& remote_candidate, |
| 186 PortInterface* origin_port); | 187 PortInterface* origin_port); |
| 187 bool CreateConnection(PortInterface* port, | 188 bool CreateConnection(PortInterface* port, |
| 188 const Candidate& remote_candidate, | 189 const Candidate& remote_candidate, |
| 189 PortInterface* origin_port); | 190 PortInterface* origin_port); |
| 190 bool FindConnection(cricket::Connection* connection) const; | 191 bool FindConnection(cricket::Connection* connection) const; |
| 191 | 192 |
| 192 uint32_t GetRemoteCandidateGeneration(const Candidate& candidate); | 193 uint32_t GetRemoteCandidateGeneration(const Candidate& candidate); |
| 193 bool IsDuplicateRemoteCandidate(const Candidate& candidate); | 194 bool IsDuplicateRemoteCandidate(const Candidate& candidate); |
| 194 void RememberRemoteCandidate(const Candidate& remote_candidate, | 195 void RememberRemoteCandidate(const Candidate& remote_candidate, |
| 195 PortInterface* origin_port); | 196 PortInterface* origin_port); |
| 196 bool IsPingable(Connection* conn); | 197 bool IsPingable(Connection* conn, uint32_t now); |
| 197 void PingConnection(Connection* conn); | 198 void PingConnection(Connection* conn); |
| 198 void AddAllocatorSession(PortAllocatorSession* session); | 199 void AddAllocatorSession(PortAllocatorSession* session); |
| 199 void AddConnection(Connection* connection); | 200 void AddConnection(Connection* connection); |
| 200 | 201 |
| 201 void OnPortReady(PortAllocatorSession *session, PortInterface* port); | 202 void OnPortReady(PortAllocatorSession *session, PortInterface* port); |
| 202 void OnCandidatesReady(PortAllocatorSession *session, | 203 void OnCandidatesReady(PortAllocatorSession *session, |
| 203 const std::vector<Candidate>& candidates); | 204 const std::vector<Candidate>& candidates); |
| 204 void OnCandidatesAllocationDone(PortAllocatorSession* session); | 205 void OnCandidatesAllocationDone(PortAllocatorSession* session); |
| 205 void OnUnknownAddress(PortInterface* port, | 206 void OnUnknownAddress(PortInterface* port, |
| 206 const rtc::SocketAddress& addr, | 207 const rtc::SocketAddress& addr, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 std::string remote_ice_ufrag_; | 250 std::string remote_ice_ufrag_; |
| 250 std::string remote_ice_pwd_; | 251 std::string remote_ice_pwd_; |
| 251 IceMode remote_ice_mode_; | 252 IceMode remote_ice_mode_; |
| 252 IceRole ice_role_; | 253 IceRole ice_role_; |
| 253 uint64_t tiebreaker_; | 254 uint64_t tiebreaker_; |
| 254 uint32_t remote_candidate_generation_; | 255 uint32_t remote_candidate_generation_; |
| 255 IceGatheringState gathering_state_; | 256 IceGatheringState gathering_state_; |
| 256 | 257 |
| 257 int check_receiving_delay_; | 258 int check_receiving_delay_; |
| 258 int receiving_timeout_; | 259 int receiving_timeout_; |
| 260 int backup_connection_ping_interval_; |
| 259 uint32_t last_ping_sent_ms_ = 0; | 261 uint32_t last_ping_sent_ms_ = 0; |
| 260 bool gather_continually_ = false; | 262 bool gather_continually_ = false; |
| 261 int weak_ping_delay_ = WEAK_PING_DELAY; | 263 int weak_ping_delay_ = WEAK_PING_DELAY; |
| 264 TransportChannelState channel_state_ = TransportChannelState::STATE_INIT; |
| 262 | 265 |
| 263 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 266 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
| 264 }; | 267 }; |
| 265 | 268 |
| 266 } // namespace cricket | 269 } // namespace cricket |
| 267 | 270 |
| 268 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 271 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
| OLD | NEW |