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

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
Index: webrtc/base/virtualsocketserver.h
diff --git a/webrtc/base/virtualsocketserver.h b/webrtc/base/virtualsocketserver.h
index b96269c52c46e93b12f2d79afe8ab8508321f202..c708bb4a8915428f5436ed462b85b3b37f9a8fc8 100644
--- a/webrtc/base/virtualsocketserver.h
+++ b/webrtc/base/virtualsocketserver.h
@@ -38,6 +38,11 @@ class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> {
SocketServer* socketserver() { return server_; }
+ // The default route indicates which local address to use when a socket is
+ // bound to the 'any' address, e.g. 0.0.0.0.
+ IPAddress GetDefaultRoute(int family);
+ void SetDefaultRoute(const IPAddress& from_addr);
+
// Limits the network bandwidth (maximum bytes per second). Zero means that
// all sends occur instantly. Defaults to 0.
uint32 bandwidth() const { return bandwidth_; }
@@ -224,6 +229,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 +256,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 +302,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_;

Powered by Google App Engine
This is Rietveld 408576698