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

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

Issue 1944003002: Increase the stun ping interval. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix naming issue in unit test before committing. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 06efd2d3c235c4e976fda6f610c187741ac7542f..65932b9c9f0f400636fca9f558a2bc04b68456de 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -530,7 +530,7 @@ class Connection : public CandidatePairInterface,
// Called when this connection should try checking writability again.
int64_t last_ping_sent() const { return last_ping_sent_; }
void Ping(int64_t now);
- void ReceivedPingResponse();
+ void ReceivedPingResponse(int rtt);
int64_t last_ping_response_received() const {
return last_ping_response_received_;
}
@@ -585,6 +585,8 @@ class Connection : public CandidatePairInterface,
// response in milliseconds
int64_t last_received() const;
+ bool stable(int64_t now);
+
protected:
enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE };
@@ -602,6 +604,12 @@ class Connection : public CandidatePairInterface,
void OnConnectionRequestTimeout(ConnectionRequest* req);
void OnConnectionRequestSent(ConnectionRequest* req);
+ bool rtt_converged();
+
+ // If the response is not received within 2 * RTT, the response is assumed to
+ // be missing.
+ bool missing_responses(int64_t now);
+
// Changes the state and signals if necessary.
void set_write_state(WriteState value);
void set_receiving(bool value);
@@ -628,6 +636,7 @@ class Connection : public CandidatePairInterface,
IceMode remote_ice_mode_;
StunRequestManager requests_;
int rtt_;
+ int rtt_samples_ = 0;
int64_t last_ping_sent_; // last time we sent a ping to the other side
int64_t last_ping_received_; // last time we received a ping from the other
// side
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698