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

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

Issue 1737493004: Keep on sending stun binding requests on zero-cost networks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added tests, chaneged to 64bit lifetime. Created 4 years, 10 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/stunport.h
diff --git a/webrtc/p2p/base/stunport.h b/webrtc/p2p/base/stunport.h
index ecf61a782dfc13ad2d3e64df48dbaa45c5c51324..2ab6048c50230506669fb49012b32dce72dc28c6 100644
--- a/webrtc/p2p/base/stunport.h
+++ b/webrtc/p2p/base/stunport.h
@@ -106,6 +106,14 @@ class UDPPort : public Port {
return stun_keepalive_delay_;
}
+ // Visible for testing.
+ int stun_keepalive_lifetime() const { return stun_keepalive_lifetime_; }
+ void set_stun_keepalive_lifetime(int lifetime) {
+ stun_keepalive_lifetime_ = lifetime;
+ }
+ // Returns true if there is a pending request with type |msg_type|.
+ bool RequestExists(int msg_type) { return requests_.Exist(msg_type); }
pthatcher1 2016/03/02 20:25:59 A better name might be HasPendingRequest
honghaiz3 2016/03/02 23:22:51 Done.
+
protected:
UDPPort(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
@@ -217,6 +225,7 @@ class UDPPort : public Port {
rtc::scoped_ptr<AddressResolver> resolver_;
bool ready_;
int stun_keepalive_delay_;
+ int stun_keepalive_lifetime_;
// This is true by default and false when
// PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE is specified.
« no previous file with comments | « webrtc/base/network.h ('k') | webrtc/p2p/base/stunport.cc » ('j') | webrtc/p2p/base/stunport.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698