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

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

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: First-cut Created 5 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
Index: webrtc/p2p/base/port.cc
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc
index 25b5efd05689ef2e31da3ce4ac512ed4d14c61b4..62e659fcf80b5e0d4207a65487403460b5556f26 100644
--- a/webrtc/p2p/base/port.cc
+++ b/webrtc/p2p/base/port.cc
@@ -1003,7 +1003,6 @@ void Connection::OnReadPacket(
if (read_state_ == STATE_READABLE) {
// readable means data from this address is acceptable
// Send it on!
-
last_data_received_ = rtc::Time();
recv_rate_tracker_.Update(size);
SignalReadPacket(this, data, size, packet_time);
@@ -1444,6 +1443,13 @@ void Connection::OnMessage(rtc::Message *pmsg) {
delete this;
}
+bool Connection::CheckReceiving(uint32 receiving_timeout) {
+ uint32 min_last_recv_time = rtc::Time() - receiving_timeout;
+ return last_ping_received_ >= min_last_recv_time ||
+ last_ping_response_received_ >= min_last_recv_time ||
+ last_data_received_ >= min_last_recv_time;
pthatcher1 2015/06/24 23:42:52 Instead of using this method, we could just have m
honghaiz3 2015/08/05 23:56:56 If we do that, we will have to expose three public
+}
+
size_t Connection::recv_bytes_second() {
return recv_rate_tracker_.units_second();
}

Powered by Google App Engine
This is Rietveld 408576698