Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 1577233006: Implement Turn/Turn first logic for connection selection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: fix a bug Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // STRONG_PING_DELAY (480ms) is applied when the best connection is both 191 // STRONG_PING_DELAY (480ms) is applied when the best connection is both
192 // writable and receiving. 192 // writable and receiving.
193 static const uint32_t STRONG_PING_DELAY = 1000 * PING_PACKET_SIZE / 1000; 193 static const uint32_t STRONG_PING_DELAY = 1000 * PING_PACKET_SIZE / 1000;
194 // WEAK_PING_DELAY (48ms) is applied when the best connection is either not 194 // WEAK_PING_DELAY (48ms) is applied when the best connection is either not
195 // writable or not receiving. 195 // writable or not receiving.
196 const uint32_t WEAK_PING_DELAY = 1000 * PING_PACKET_SIZE / 10000; 196 const uint32_t WEAK_PING_DELAY = 1000 * PING_PACKET_SIZE / 10000;
197 197
198 // If the current best connection is both writable and receiving, then we will 198 // If the current best connection is both writable and receiving, then we will
199 // also try hard to make sure it is pinged at this rate (a little less than 199 // also try hard to make sure it is pinged at this rate (a little less than
200 // 2 * STRONG_PING_DELAY). 200 // 2 * STRONG_PING_DELAY).
201 static const uint32_t MAX_CURRENT_STRONG_DELAY = 900; 201 const uint32_t MAX_CURRENT_STRONG_DELAY = 900;
202 202
203 static const int MIN_CHECK_RECEIVING_DELAY = 50; // ms 203 static const int MIN_CHECK_RECEIVING_DELAY = 50; // ms
204 204
205 P2PTransportChannel::P2PTransportChannel(const std::string& transport_name, 205 P2PTransportChannel::P2PTransportChannel(const std::string& transport_name,
206 int component, 206 int component,
207 P2PTransport* transport, 207 P2PTransport* transport,
208 PortAllocator* allocator) 208 PortAllocator* allocator)
209 : TransportChannelImpl(transport_name, component), 209 : TransportChannelImpl(transport_name, component),
210 transport_(transport), 210 transport_(transport),
211 allocator_(allocator), 211 allocator_(allocator),
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 SignalSentPacket(this, sent_packet); 1431 SignalSentPacket(this, sent_packet);
1432 } 1432 }
1433 1433
1434 void P2PTransportChannel::OnReadyToSend(Connection* connection) { 1434 void P2PTransportChannel::OnReadyToSend(Connection* connection) {
1435 if (connection == best_connection_ && writable()) { 1435 if (connection == best_connection_ && writable()) {
1436 SignalReadyToSend(this); 1436 SignalReadyToSend(this);
1437 } 1437 }
1438 } 1438 }
1439 1439
1440 } // namespace cricket 1440 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698