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(); |
} |