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 22 matching lines...) Expand all Loading... | |
33 #include "webrtc/p2p/base/portallocator.h" | 33 #include "webrtc/p2p/base/portallocator.h" |
34 #include "webrtc/p2p/base/portinterface.h" | 34 #include "webrtc/p2p/base/portinterface.h" |
35 #include "webrtc/p2p/base/transportchannelimpl.h" | 35 #include "webrtc/p2p/base/transportchannelimpl.h" |
36 #include "webrtc/base/asyncpacketsocket.h" | 36 #include "webrtc/base/asyncpacketsocket.h" |
37 #include "webrtc/base/sigslot.h" | 37 #include "webrtc/base/sigslot.h" |
38 | 38 |
39 namespace cricket { | 39 namespace cricket { |
40 | 40 |
41 extern const int WEAK_PING_INTERVAL; | 41 extern const int WEAK_PING_INTERVAL; |
42 static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3; | 42 static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3; |
43 static const int MIN_PINGS_FOR_RTT_CONVERGENCE = 10; | |
pthatcher1
2016/06/01 23:22:03
I think a better name would be something like MIN_
| |
43 | 44 |
44 struct IceParameters { | 45 struct IceParameters { |
45 std::string ufrag; | 46 std::string ufrag; |
46 std::string pwd; | 47 std::string pwd; |
47 IceParameters(const std::string& ice_ufrag, const std::string& ice_pwd) | 48 IceParameters(const std::string& ice_ufrag, const std::string& ice_pwd) |
48 : ufrag(ice_ufrag), pwd(ice_pwd) {} | 49 : ufrag(ice_ufrag), pwd(ice_pwd) {} |
49 | 50 |
50 bool operator==(const IceParameters& other) { | 51 bool operator==(const IceParameters& other) { |
51 return ufrag == other.ufrag && pwd == other.pwd; | 52 return ufrag == other.ufrag && pwd == other.pwd; |
52 } | 53 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 bool CreateConnection(PortInterface* port, | 221 bool CreateConnection(PortInterface* port, |
221 const Candidate& remote_candidate, | 222 const Candidate& remote_candidate, |
222 PortInterface* origin_port); | 223 PortInterface* origin_port); |
223 bool FindConnection(cricket::Connection* connection) const; | 224 bool FindConnection(cricket::Connection* connection) const; |
224 | 225 |
225 uint32_t GetRemoteCandidateGeneration(const Candidate& candidate); | 226 uint32_t GetRemoteCandidateGeneration(const Candidate& candidate); |
226 bool IsDuplicateRemoteCandidate(const Candidate& candidate); | 227 bool IsDuplicateRemoteCandidate(const Candidate& candidate); |
227 void RememberRemoteCandidate(const Candidate& remote_candidate, | 228 void RememberRemoteCandidate(const Candidate& remote_candidate, |
228 PortInterface* origin_port); | 229 PortInterface* origin_port); |
229 bool IsPingable(Connection* conn, int64_t now); | 230 bool IsPingable(Connection* conn, int64_t now); |
231 bool IsBestConnectionPingable(); | |
232 bool NeedToPingFast(Connection* conn); | |
230 void PingConnection(Connection* conn); | 233 void PingConnection(Connection* conn); |
231 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); | 234 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); |
232 void AddConnection(Connection* connection); | 235 void AddConnection(Connection* connection); |
233 | 236 |
234 void OnPortReady(PortAllocatorSession *session, PortInterface* port); | 237 void OnPortReady(PortAllocatorSession *session, PortInterface* port); |
235 void OnCandidatesReady(PortAllocatorSession *session, | 238 void OnCandidatesReady(PortAllocatorSession *session, |
236 const std::vector<Candidate>& candidates); | 239 const std::vector<Candidate>& candidates); |
237 void OnCandidatesAllocationDone(PortAllocatorSession* session); | 240 void OnCandidatesAllocationDone(PortAllocatorSession* session); |
238 void OnUnknownAddress(PortInterface* port, | 241 void OnUnknownAddress(PortInterface* port, |
239 const rtc::SocketAddress& addr, | 242 const rtc::SocketAddress& addr, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
332 TransportChannelState state_ = TransportChannelState::STATE_INIT; | 335 TransportChannelState state_ = TransportChannelState::STATE_INIT; |
333 IceConfig config_; | 336 IceConfig config_; |
334 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. | 337 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. |
335 | 338 |
336 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 339 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
337 }; | 340 }; |
338 | 341 |
339 } // namespace cricket | 342 } // namespace cricket |
340 | 343 |
341 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 344 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
OLD | NEW |