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

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

Issue 1371623003: Delete a connection only if it has timed out on writing and not receiving for 10 seconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: A minor change in GetStats Created 5 years, 3 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.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 47903be05b55753b063e6bc8630946d8938e59a1..866f65f3ab6f8ee01c5d5882223f5ac807574b74 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -50,9 +50,9 @@ extern const char TCPTYPE_ACTIVE_STR[];
extern const char TCPTYPE_PASSIVE_STR[];
extern const char TCPTYPE_SIMOPEN_STR[];
-// If a connection does not receive anything for this long, it is considered
-// dead.
-const uint32 DEAD_CONNECTION_RECEIVE_TIMEOUT = 30 * 1000; // 30 seconds.
+// If a connection does not receive anything for this long and it has timed out
+// on writing, it will be deleted.
+const uint32 DEAD_CONNECTION_RECEIVE_TIMEOUT = 10 * 1000; // 10 seconds.
pthatcher1 2015/09/28 23:07:28 I think there are actually two different things he
honghaiz3 2015/09/29 18:47:50 Done.
// The timeout duration when a connection does not receive anything.
const uint32 WEAK_CONNECTION_RECEIVE_TIMEOUT = 2500; // 2.5 seconds
@@ -573,7 +573,7 @@ class Connection : public rtc::MessageHandler,
void set_connected(bool value);
// Checks if this connection is useless, and hence, should be destroyed.
- void CheckTimeout();
+ void CheckTimeout(uint32 now);
void OnMessage(rtc::Message *pmsg);
@@ -615,6 +615,7 @@ class Connection : public rtc::MessageHandler,
State state_;
// Time duration to switch from receiving to not receiving.
uint32 receiving_timeout_;
+ uint32 time_created_ms_;
friend class Port;
friend class ConnectionRequest;

Powered by Google App Engine
This is Rietveld 408576698