Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index 672abb7423b95f1904428c0a8873d4e6c6262c32..637708262c7cd9b701f43693699cad98d1714c3d 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -43,8 +43,8 @@ namespace cricket { |
enum class IceRestartState { CONNECTING, CONNECTED, DISCONNECTED, MAX_VALUE }; |
extern const int WEAK_PING_INTERVAL; |
-extern const int STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL; |
-extern const int STABLE_WRITABLE_CONNECTION_PING_INTERVAL; |
+extern const int WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL; |
+extern const int STRONG_AND_STABLE_WRITABLE_CONNECTION_PING_INTERVAL; |
static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3; |
// Adds the port on which the candidate originated. |
@@ -261,7 +261,9 @@ class P2PTransportChannel : public TransportChannelImpl, |
void RememberRemoteCandidate(const Candidate& remote_candidate, |
PortInterface* origin_port); |
bool IsPingable(const Connection* conn, int64_t now) const; |
- bool IsSelectedConnectionPingable(int64_t now); |
+ // Whether a premier connection is pingable, where a premier connection is |
+ // the top-ranked connection on each network. |
+ bool IsPremierConnectionPingable(Connection* premier_conn, int64_t now); |
int CalculateActiveWritablePingInterval(const Connection* conn, |
int64_t now) const; |
void PingConnection(Connection* conn); |
@@ -317,12 +319,15 @@ class P2PTransportChannel : public TransportChannelImpl, |
// Returns true if the new_connection is selected for transmission. |
bool MaybeSwitchSelectedConnection(Connection* new_connection, |
const std::string& reason); |
- |
+ // Gets all premier connections on all networks. |
+ std::map<rtc::Network*, Connection*> GetPremierConnectionsByNetwork() const; |
void PruneConnections(); |
bool IsBackupConnection(const Connection* conn) const; |
Connection* FindConnectionToPing(int64_t now); |
Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now); |
+ // Finds the best premier connection for pinging. |
pthatcher1
2016/10/24 20:49:05
I find this confusing since "best" and "premier" a
honghaiz3
2016/10/24 23:35:09
Removed this method base on another suggestion.
|
+ Connection* FindBestPremierConnectionToPing(int64_t now); |
// Between |conn1| and |conn2|, this function returns the one which should |
// be pinged first. |
Connection* SelectMostPingableConnection(Connection* conn1, |