Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index 7ffa4300893141a2e61ff74ba40ab8c966704a50..cd592b4980d4c193c91cb7cdb7071a406cb2ae5c 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -256,7 +256,7 @@ 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); |
+ bool IsPremierConnectionPingable(Connection* conn, int64_t now); |
Taylor Brandstetter
2016/10/04 02:08:10
Can you explain in a comment somewhere what's mean
honghaiz3
2016/10/20 23:47:58
Done.
|
int CalculateActiveWritablePingInterval(const Connection* conn, |
int64_t now) const; |
void PingConnection(Connection* conn); |
@@ -312,12 +312,16 @@ class P2PTransportChannel : public TransportChannelImpl, |
// Returns true if the new_connection is selected for transmission. |
bool MaybeSwitchSelectedConnection(Connection* new_connection, |
const std::string& reason); |
- |
+ // Updates the premier connection for each network name. This method is |
+ // called every time after connections are sorted. |
+ void UpdatePremierConnections(); |
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. |
+ Connection* FindBestPremierConnectionToPing(int64_t now); |
// Between |conn1| and |conn2|, this function returns the one which should |
// be pinged first. |
Connection* SelectMostPingableConnection(Connection* conn1, |
@@ -370,6 +374,9 @@ class P2PTransportChannel : public TransportChannelImpl, |
std::set<Connection*> unpinged_connections_; |
Connection* selected_connection_ = nullptr; |
+ // The top-ranked connection for each network interface, identified by the |
+ // interface name. |
+ std::map<std::string, Connection*> premier_connection_by_network_name_; |
Taylor Brandstetter
2016/10/04 02:08:10
Can't this be determined algorithmically from conn
honghaiz3
2016/10/20 23:47:58
Done.
|
std::vector<RemoteCandidate> remote_candidates_; |
bool sort_dirty_; // indicates whether another sort is needed right now |