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

Unified Diff: webrtc/base/virtualsocketserver.h

Issue 1274013002: Bug 4865: Enable connectivity when the remote peer is on public internet. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 4 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 | « no previous file | webrtc/base/virtualsocketserver.cc » ('j') | webrtc/base/virtualsocketserver.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/virtualsocketserver.h
diff --git a/webrtc/base/virtualsocketserver.h b/webrtc/base/virtualsocketserver.h
index b96269c52c46e93b12f2d79afe8ab8508321f202..e21983377c992a66030ab88cdf87cda0e768a536 100644
--- a/webrtc/base/virtualsocketserver.h
+++ b/webrtc/base/virtualsocketserver.h
@@ -38,6 +38,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
SocketServer* socketserver() { return server_; }
+ // Default route will be used when a binding is done against the any address.
juberti1 2015/08/06 23:43:21 // The default route indicates which local address
guoweis_webrtc 2015/08/07 18:03:43 Done.
+ const IPAddress GetDefaultRoute(int family);
juberti1 2015/08/06 23:43:21 'const' not useful on by-value types
guoweis_webrtc 2015/08/07 18:03:43 Done.
+ void SetDefaultRoute(const IPAddress& ipaddr);
juberti1 2015/08/06 23:43:21 Make it clear this is the source address, i.e. cal
guoweis_webrtc 2015/08/07 18:03:43 Done.
+
// Limits the network bandwidth (maximum bytes per second). Zero means that
// all sends occur instantly. Defaults to 0.
uint32 bandwidth() const { return bandwidth_; }
@@ -124,6 +128,10 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
IPAddress GetNextIP(int family);
uint16 GetNextPort();
+ // Helper function to return the binding from the any address to default
+ // interface.
+ const SocketAddress GetDefaultRouteIfNecessary(const SocketAddress& addr);
juberti1 2015/08/06 23:43:21 see comment above about const
guoweis_webrtc 2015/08/07 18:03:43 Done.
+
VirtualSocket* CreateSocketInternal(int family, int type);
// Binds the given socket to addr, assigning and IP and Port if necessary
@@ -224,6 +232,9 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
AddressMap* bindings_;
ConnectionMap* connections_;
+ IPAddress default_route_v4_;
+ IPAddress default_route_v6_;
+
uint32 bandwidth_;
uint32 network_capacity_;
uint32 send_buffer_capacity_;
@@ -248,9 +259,6 @@ class VirtualSocket : public AsyncSocket, public MessageHandler {
SocketAddress GetLocalAddress() const override;
SocketAddress GetRemoteAddress() const override;
- // Used by server sockets to set the local address without binding.
- void SetLocalAddress(const SocketAddress& addr);
-
// Used by TurnPortTest to mimic a case where proxy returns local host address
// instead of the original one TurnPort was bound against. Please see WebRTC
// issue 3927 for more detail.
@@ -297,6 +305,9 @@ class VirtualSocket : public AsyncSocket, public MessageHandler {
int SendUdp(const void* pv, size_t cb, const SocketAddress& addr);
int SendTcp(const void* pv, size_t cb);
+ // Used by server sockets to set the local address without binding.
+ void SetLocalAddress(const SocketAddress& addr);
+
VirtualSocketServer* server_;
int family_;
int type_;
« no previous file with comments | « no previous file | webrtc/base/virtualsocketserver.cc » ('j') | webrtc/base/virtualsocketserver.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698