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

Unified Diff: webrtc/p2p/base/p2ptransportchannel.h

Issue 2369963004: Ping the premier connection on each network with higher priority. (Closed)
Patch Set: Add a header file <iterator> Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/firewallsocketserver.cc ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 672abb7423b95f1904428c0a8873d4e6c6262c32..cdb83005b6a2a519d247bf03b0df713aee979c4a 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,10 @@ 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 writable connection is past its ping interval and needs to be
+ // pinged again.
+ bool WritableConnectionPastPingInterval(const Connection* conn,
+ int64_t now) const;
int CalculateActiveWritablePingInterval(const Connection* conn,
int64_t now) const;
void PingConnection(Connection* conn);
@@ -317,16 +320,16 @@ class P2PTransportChannel : public TransportChannelImpl,
// Returns true if the new_connection is selected for transmission.
bool MaybeSwitchSelectedConnection(Connection* new_connection,
const std::string& reason);
-
+ // Gets the best connection for each network.
+ std::map<rtc::Network*, Connection*> GetBestConnectionByNetwork() const;
+ std::vector<Connection*> GetBestWritableConnectionPerNetwork() const;
void PruneConnections();
bool IsBackupConnection(const Connection* conn) const;
- Connection* FindConnectionToPing(int64_t now);
Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now);
// Between |conn1| and |conn2|, this function returns the one which should
// be pinged first.
- Connection* SelectMostPingableConnection(Connection* conn1,
- Connection* conn2);
+ Connection* MorePingable(Connection* conn1, Connection* conn2);
// Select the connection which is Relay/Relay. If both of them are,
// UDP relay protocol takes precedence.
Connection* MostLikelyToWork(Connection* conn1, Connection* conn2);
« no previous file with comments | « webrtc/base/firewallsocketserver.cc ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698